{"id":28633476,"url":"https://github.com/ckeditor/ckeditor4-workflows-common","last_synced_at":"2025-10-24T16:49:16.196Z","repository":{"id":40428715,"uuid":"308052164","full_name":"ckeditor/ckeditor4-workflows-common","owner":"ckeditor","description":"Shared CKEditor 4 GitHub workflows.","archived":false,"fork":false,"pushed_at":"2022-05-09T10:29:52.000Z","size":160,"stargazers_count":1,"open_issues_count":14,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-23T13:02:23.648Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ckeditor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-28T15:02:43.000Z","updated_at":"2023-12-04T23:09:12.000Z","dependencies_parsed_at":"2022-08-09T20:10:42.598Z","dependency_job_id":null,"html_url":"https://github.com/ckeditor/ckeditor4-workflows-common","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ckeditor/ckeditor4-workflows-common","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckeditor%2Fckeditor4-workflows-common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckeditor%2Fckeditor4-workflows-common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckeditor%2Fckeditor4-workflows-common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckeditor%2Fckeditor4-workflows-common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ckeditor","download_url":"https://codeload.github.com/ckeditor/ckeditor4-workflows-common/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ckeditor%2Fckeditor4-workflows-common/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259490549,"owners_count":22865767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T15:08:35.623Z","updated_at":"2025-10-24T16:49:16.126Z","avatar_url":"https://github.com/ckeditor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CKEditor 4 Workflows Common\n\nShared CKEditor 4 GitHub workflows.\n\n## How it works?\n\nThe main function of this repository is to propagate common workflows and keep them up to date.\n\nThe `setup-workflows.yml` workflow checkouts this repository once a day in the target repository and updates (or creates) all common workflows. Common workflows are stored in `workflows/` directory here and are copied to `.github/workflows/` directory in a target repository. There is also `setup-workflows.yml` workflow there, which means, once it is set it will auto-update itself too.\n\n## Setup\n\n1. Copy `workflows/setup-workflows.yml` workflow to your repository as `.github/workflows/setup-workflows.yml`.\n1. Setup `secrets.GH_BOT_USERNAME` and `secrets.GH_BOT_EMAIL` to GitHub user which has a push access to your repository.\n1. Setup `secrets.GH_WORKFLOWS_TOKEN` to GitHub token which has `write` and `workflows` permissions.\n\n## Optional configuration\n\nSome workflows may be altered by configuration options (refer to [Available workflows](#available-workflows) section below). The configuration file is optional and not present by default. If needed, it should be added to any repository using common workflows as `.github/workflows-config.json` file.\n\n### Loading configuration file\n\nFor any workflow which needs to load and use configuration values, it is recommended to load config as soon as possible (so right after checkout) using [jq](https://stedolan.github.io/jq/) like:\n\n```yml\n- name: Read config\n  run: |\n    CONFIG='{}'\n    if [[ -f \"./.github/workflows-config.json\" ]]; then\n      CONFIG=$( jq -c .setupWorkflows './.github/workflows-config.json' )\n    fi\n    echo \"CONFIG=$CONFIG\" \u003e\u003e $GITHUB_ENV\n    echo \"Workflow config: $CONFIG\"\n```\n\nThen, further in the workflow any step can use `${{ env.CONFIG }}` variable and read any configuration properties like:\n\n```bash\nAS_PR=$(echo '${{ env.CONFIG }}' | jq -r \".pushAsPullRequest\")\n```\n\nIf the workflow can be also triggered manually, it is usually useful to provide a way to use custom config for such runs, for example:\n\n```yml\non:\n  workflow_dispatch:\n    inputs:\n      config:\n        description: 'Config'\n        required: false\n        default: ''\n\n...\n\n- name: Read config\n  run: |\n    CONFIG='{}'\n    if [[ ! -z '${{ github.event.inputs.config }}' ]]; then\n      CONFIG='${{ github.event.inputs.config }}'\n    elif [[ -f \"./.github/workflows-config.json\" ]]; then\n      CONFIG=$( jq -c .setupWorkflows './.github/workflows-config.json' )\n    fi\n    echo \"CONFIG=$CONFIG\" \u003e\u003e $GITHUB_ENV\n    echo \"Workflow config: $CONFIG\"\n```\n\n## Available workflows\n\n### setup-workflows\n\nThis is the main workflow responsible for propagating all common workflows. When it is added to any other repository it checkouts this repository and copies all common workflows from `workflows/` directory to `.github/workflows/` one. It is run once a day (at 02:00 UTC) so any changes are propagated on a daily basis. See `workflows/setup-workflows.yml` file.\n\nIt is a cron job task so will be triggered only on main repository branch.\n\n#### Required secrets\n\n* `GH_WORKFLOWS_TOKEN` - GitHub token which is used for all commit/push/pr actions. It should have write and workflows access.\n* `GH_BOT_EMAIL` - GitHub user email which acts as an author of all commits done by this job.\n* `GH_BOT_USERNAME` - GitHub user username which acts as an author of all commits done by this job.\n\n#### Optional configuration\n\n* `setupWorkflows.pushAsPullRequest` : `Boolean` If set to true, workflows update will be created as PR instead of being pushed directly to the main branch.\n\n### stalebot\n\nWorkflow responsible for handling stale issues and PRs. It is a cron job task so will be triggered only on a main repository branch. See `workflows/stalebot.yml` file.\n\n#### Required secrets\n\n_None_\n\n#### Other requirements\n\nSince this workflow uses labels to mark stale issues/PRs, labels should be already defined in the target repository:\n\n* `stale` - label used to mark stale issues/PRs.\n* `status:confirmed` - label used to filter out confirmed issues. Such issues are not processed by `stalebot`.\n* `resolution:expired` - label added to stale issues which got closed due to inactivity.\n* `pr:frozen ❄` - label added to stale PRs which got closed due to inactivity.\n\n### update-deps\n\nWorkflow responsible for updating NPM dependencies. It is run on 1st and 15th day of each month (at 05:00 UTC) and creates two PRs - one for dev dependencies and one for production ones (if there are any outdated dependencies). It checks `package.json` file in the repository root and uses `npm-check` to update all dev/prod dependencies (which means `package.json` versioning is not respected). It is a cron job task so will be triggered only on main repository branch. See `workflows/update-deps.yml` file.\n\n#### Required secrets\n\n* `GH_BOT_EMAIL` - GitHub user email which acts as an author of all commits done by this job.\n* `GH_BOT_USERNAME` - GitHub user username which acts as an author of all commits done by this job.\n\n#### Optional configuration\n\n* `updateDeps.targetBranch` : `String` Target branch name. By default, workflow runs on main repository branch.\n\n## Testing\n\n### Running tests\n\nTo run tests, create `.env` file with the following variables:\n\n* `AUTH_KEY` - GitHub key with permissions to commit files, read and run workflows / actions.\n* `OWNER` - Owner of tests repo, e.g. `ckeditor`.\n* `REPO` - Tests repo name, e.g. `workflow-tests`. It should be an empty repository with `master` branch and `README.md` file only.\n\nThen run:\n\n```\nnpm test\n```\n\n### Adding tests\n\nTests case for new workflows should be added in `tests/fixtures` directory - for example `new-workflow.yml` should be covered with tests from `tests/fixtures/new-workflow.js`. The test file should export array of tests cases (see example below).\n\nNew test cases for existing workflows should be added in their test file in `tests/fixtures` directory with the same name.\n\nAll additional files required for tests should be added in `tests/assets` directory.\n\nEach setup has similar structure:\n* `name` - Test name which will be displayed in the console when test starts.\n* `workflow` - The name of workflow configuration file, ends with the file extension. E.g. 'setup-workflows.yml'. This file will be automatically added to files list.\n* `branch` - Branch which should be used to commit files to and verify workflow run.\n* `config` - Object with a configuration that will be passed to workflow during dispatching.\n* `fileList` - Array of files that will be committed to the specified `branch`.\n  * `src` - Path to a source file, related to `assets` directory.\n  * `dst` - Path to a destination file in the test repo.\n\nFor example:\n\n```js\n{\n\tname: 'setup-workflows direct PR',\n\tworkflow: 'setup-workflows.yml',\n\tbranch: 'master',\n\tconfig: {\n\t\t'updateDeps': {\n\t\t\t'targetBranch': 'master'\n\t\t}\n\t},\n\tfileList: [\n\t\t{\n\t\t\tsrc: 'deps-package.json',\n\t\t\tdest: 'package.json'\n\t\t}\n\t]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fckeditor%2Fckeditor4-workflows-common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fckeditor%2Fckeditor4-workflows-common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fckeditor%2Fckeditor4-workflows-common/lists"}