ci: Refresh and commit manifest files for patch PRs #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Patch PR | |
on: | |
pull_request: | |
paths: | |
- 'patches.nix' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
refresh-and-commit: | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/master' | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: cachix/install-nix-action@v22 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: fuellabs | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- run: nix run .#refresh-manifests | |
timeout-minutes: 120 | |
- name: validate changed nix files | |
run: | | |
files=( $(git diff --name-only '*.nix') ) | |
echo "${#files[*]} nix files changed: ${files[*]}" | |
if [[ "${#files[*]}" -ne 0 ]]; then | |
nix-instantiate --parse "${files[@]}" >/dev/null | |
fi | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
branch: ${{ github.ref_name }} | |
commit_message: 'ci: refresh manifests for patch PR' | |
file_pattern: 'manifests/*' |