{"id":16370721,"url":"https://github.com/integralist/actions-testing","last_synced_at":"2026-03-09T15:31:21.817Z","repository":{"id":43199618,"uuid":"434252924","full_name":"Integralist/actions-testing","owner":"Integralist","description":"Testing GitHub Actions","archived":false,"fork":false,"pushed_at":"2025-05-21T10:10:17.000Z","size":255,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-17T17:43:38.932Z","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/Integralist.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-12-02T14:29:06.000Z","updated_at":"2025-05-21T10:10:20.000Z","dependencies_parsed_at":"2023-11-08T12:38:39.409Z","dependency_job_id":"b0fba400-8af1-43a7-9ae6-27fc9a8efcc0","html_url":"https://github.com/Integralist/actions-testing","commit_stats":{"total_commits":126,"total_committers":4,"mean_commits":31.5,"dds":0.07936507936507942,"last_synced_commit":"780657c733e4191c7d9ed69480a8a8776b023a71"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/Integralist/actions-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Factions-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Factions-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Factions-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Factions-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Integralist","download_url":"https://codeload.github.com/Integralist/actions-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Factions-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30301109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-10-11T03:05:48.574Z","updated_at":"2026-03-09T15:31:21.795Z","avatar_url":"https://github.com/Integralist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Gotchas\n\n- Use single quotes when using operators like `==` (double quotes are invalid).\n\n## Scheduled Jobs (cron)\n\n```yaml\non:\n  push:\n  schedule:\n    - cron: '0 0 1 * *'   # https://crontab.guru/every-month\n    - cron: '*/5 * * * *' # https://crontab.guru/every-5-minutes\n```\n\n\u003e **NOTE**: We don't specify a value for `push` key which means run whenever a push is triggered on any branch.\n\n## Automatically cancel in-flight workflows\n\nThe `concurrency` setting allows you to restrict a workflow to one 'group' at a time.\n\nNow if you're working on a PR which executes a workflow, then the workflow is likely getting run on every single push to the PR.\n\nAn example of why this is a problem is if you have just pushed a _broken_ commit and now you're pushing a new commit on top to fix it, then the workflow from the previous commit (the broken one) is still going to run, it's still going to use up resources but ultimately it's going to fail.\n\nWhat you want to have happen is when the second commit is pushed, it cancels running the workflow on the previous commit which we know to be broken any way. Hell, it's nice to have this behaviour if you're pushing commits at just a regular pace! Why have a bunch of in-flight workflows runnings on old code.\n\nTo get this to work you set both the `concurrency` group _and_ `cancel-in-progress`:\n\n```yaml\nconcurrency:\n  group: ${{ github.ref_name }}\n  cancel-in-progress: true\n```\n\n## Persisting Data\n\nGitHub says you can use 'caching' or 'artifacts' to persist data between jobs. But you can also persist data by using the JSON output of one job as the `strategy.matrix` input for another job:\n\n\u003e **NOTE**: Not restricted to using `strategy.matrix`, you can just use the output data however you like. See [later in the README](#using-shared-job-data-to-determine-if-subsequent-job-should-run) for an example.\n\n```yaml\nname: example\non: push\njobs:\n  job1:\n    runs-on: ubuntu-latest\n    outputs:\n      matrix: ${{ steps.set-matrix.outputs.matrix }}\n    steps:\n      - id: set-matrix\n        run: echo \"::set-output name=matrix::{\\\"FOO\\\":[\"abc\"],\\\"BAR\\\":[\"xyz\"]}\"\n  job2:\n    needs: job1\n    runs-on: ubuntu-latest\n    strategy:\n      matrix: ${{fromJSON(needs.job1.outputs.matrix)}}\n    env:\n      FOO: ${{ matrix.FOO }}\n      BAR: ${{ matrix.BAR }}\n    steps:\n      - run: echo ${{ matrix.FOO }} # abc\n      - run: echo ${{ matrix.BAR }} # xyz\n```\n\n\u003e **NOTE**: Be sure to set the value of each matrix field to a list type containing a single entry, otherwise the strategy.matrix will fail to parse the JSON format. This is because a strategy.matrix is typically used to generate multiple 'variants' of a job. By setting a single value inside a list, we ensure there is only ever one job variant generated (i.e. only one job is created), and that single job can simply reference the fields within the matrix as data points of interest.\n\n\u003e **UPDATE**: `::set-output` is deprecated in favour of sending `key=value` to `$GITHUB_OUTPUT` (e.g. `echo \"nvmrc-version=$(cat .nvmrc)\" \u003e\u003e $GITHUB_OUTPUT`).\n\n### Clarify the cache action\n\nThe `actions/cache@v2` works like so...\n\n```yaml\n- uses: actions/cache@v2\n  with:\n    path: path/to/be/cached\n    key: ${{ runner.os }}-my-cache-key\n```\n\nWhen the step that implements the action is executed (see above snippet), the cache action simply looks up the cache key (e.g. `Linux-my-cache-key`) and if it finds something in the cache, then it restores the cache to the path you specified (e.g. `path/to/be/cached`).\n\nIf the cache action doesn't find anything in the cache, then nothing happens.\n\nNow the important bit: the cache action has a 'post run' event that executes once your job has finished successfully. The cache action will be run again and this time it stores whatever was in your given path into the cache using the key you said it should be stored under.\n\nThis means, when it comes to running another job, you need to ensure you define the cache action again (the same as you defined it in your first job). This is so all of what I've just explained will happen again. The only difference is that in the 'post run' event for your next job, when the action gets run again, you'll now see something like...\n\n\u003e Cache hit occurred on the primary key `Linux-my-cache-key`, not saving cache.\n\nMeaning there was nothing else to do. I imagine if there were changes to the files in the given path then it would indicate the cache was updated with the latest files.\n\n## Reusable Workflows\n\nIf you have a bunch of setup configuration that is the same between jobs, then you can move that configuration into a separate workflow file that can then be imported and used by each job in your main workflow file.\n\nThe following example, demonstrates how to _call_ (i.e. import) a reusable workflow:\n\n```yaml\njobs:\n  build:\n    ...\n\n  deploy:\n    ...\n\n  validate-foo:\n    uses: integralist/actions-testing/.github/workflows/resuable-setup@main # install node, rust, setup env vars etc\n    steps: \n      - ...\n\n  validate-bar:\n    uses: integralist/actions-testing/.github/workflows/resuable-setup@main # install node, rust, setup env vars etc\n    steps: \n      - ...\n```\n\nAn example implementation of a reusable workflow would be:\n\n```yaml\nname: Reusable workflow for validation scripts\non:\n  workflow_call:\n    inputs:\n      install_node:\n        type: bool\n      name:\n        required: true\n        type: string\n      description:\n        required: true\n        type: string\n      script:\n        required: true\n        type: string\n\njobs:\n  validation:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - if: ${{ github.event_name != 'schedule' }}\n        run: exit 1\n      - if: ${{ inputs.install_node }}\n        name: Environment\n        run: |\n          echo \"NODE_VERSION=$(cat .nvmrc)\" \u003e\u003e $GITHUB_ENV\n      - if: ${{ inputs.install_node }}\n        uses: actions/setup-node@v2\n        id: node-yarn\n        with:\n          node-version: \"${{ env.NODE_VERSION }}\"\n          cache: yarn\n      - name: status update\n        uses: ouzi-dev/commit-status-updater@v1.1.2\n        with:\n          name: ${{ inputs.name }}\n          description: ${{ inputs.description }}\n          status: pending\n      - id: validator\n        run: ${{ inputs.script }}\n      - if: ${{ success() }}\n        name: status update\n        uses: ouzi-dev/commit-status-updater@v1.1.2\n        with:\n          name: ${{ inputs.name }}\n          description: ${{ steps.validator.outputs.description }}\n          status: ${{ steps.validator.outputs.status }}\n```\n\n## Using shared job data to determine if subsequent job should run\n\nIn the following example the `bar` job will not run if the required fields `foo` and `baz` aren't set to `true`.\n\n```yaml\n  foo:\n    runs-on: ubuntu-latest\n    outputs:\n      data: ${{ steps.footest.outputs.data }}\n    steps:\n      - run: |\n          echo \"FOO=true\" \u003e\u003e $GITHUB_ENV\n          echo \"BAR=false\" \u003e\u003e $GITHUB_ENV\n          echo \"BAZ=true\" \u003e\u003e $GITHUB_ENV\n      - id: footest\n        run: echo ::set-output name=data::[\\\"foo=$FOO\\\", \\\"bar=$BAR\\\", \\\"baz=$BAZ\\\"]\n\n  bar:\n    needs: foo\n    if: ${{ contains(needs.foo.outputs.data, 'foo=true') \u0026\u0026 contains(needs.foo.outputs.data, 'baz=true') }}\n    runs-on: ubuntu-latest\n    steps:\n      - run: echo 'yay! we ran because the fields were set to true'\n      - run: exit 1\n\n  build:\n    needs: bar\n    runs-on: ubuntu-latest\n    steps:\n      - run: echo 'yay! this job ran as the bar job was successful'\n```\n\n## Committing changes directly or opening a PR\n\n```yaml\nname: Update Zone Data\n\npermissions:\n  contents: write\n  pull-requests: read\n  id-token: write\n\non:\n  # Schedule to run at 9am UTC every day (2pm PST)\n  schedule:\n    - cron: '0 09 * * *'\n\n  # Allow manual trigger via GitHub UI\n  workflow_dispatch:\n\nenv:\n  GOPRIVATE: \"github.com/fastly\"\n\njobs:\n  update-dependencies:\n    runs-on: ubuntu-latest\n\n    steps:\n    - name: Check out repository\n      uses: actions/checkout@v4\n\n    - name: Set up Go\n      uses: actions/setup-go@v5\n      with:\n        go-version-file: 'go.mod'\n\n    - name: Set up private Go modules\n      run: |\n        echo \"machine github.com login ${{ secrets.GH_PAT_CI }}\" \u003e ~/.netrc\n\n    - name: Update Dependencies\n      run: make update-dependencies\n\n    # - name: Commit changes\n    #   if: success()\n    #   run: |\n    #     git config --global user.name \"github-actions[bot]\"\n    #     git config --global user.email \"github-actions[bot]@users.noreply.github.com\"\n    #     git add .\n    #     git diff-index --quiet HEAD -- || git commit -m \"build: update api dependencies [skip ci]\" \u0026\u0026 git push\n\n    - name: Create pull request\n      uses: peter-evans/create-pull-request@v7\n      with:\n        token: ${{ secrets.GITHUB_TOKEN }}\n        commit-message: \"feat(partnerzones): updates\"\n        committer: GitHub \u003cnoreply@github.com\u003e\n        author: ${{ github.actor }} \u003c${{ github.actor }}@users.noreply.github.com\u003e\n        title: \"feat(partnerzones): updates\"\n        body: \"My PR description.\"\n        assignees: Integralist\n\n    - name: Slack ping if failure\n      if: failure()\n      run: |\n        curl -Ss -X POST -H 'Content-type: application/json' --data '{\"text\":\"❌ Example API app dependencies update failed\"}' ${{ secrets.SLACK_WEBHOOK_URL }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralist%2Factions-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintegralist%2Factions-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralist%2Factions-testing/lists"}