1 name: "Update terraform-providers"
14 contents: write # for peter-evans/create-pull-request to create branch
15 pull-requests: write # for peter-evans/create-pull-request to create a PR
16 if: github.repository_owner == 'NixOS' && github.ref == 'refs/heads/master' # ensure workflow_dispatch only runs on master
17 runs-on: ubuntu-latest
19 - uses: actions/checkout@v4
20 - uses: cachix/install-nix-action@v23
22 nix_path: nixpkgs=channel:nixpkgs-unstable
26 echo "title=terraform-providers: update $(date -u +"%Y-%m-%d")" >> $GITHUB_OUTPUT
27 - name: update terraform-providers
29 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
32 git config user.name "github-actions[bot]"
34 maintainers/scripts/update.nix \
35 --argstr commit true \
36 --argstr keep-going true \
37 --argstr max-workers 2 \
38 --argstr path terraform-providers
39 - name: get failed updates
41 echo 'FAILED<<EOF' >> $GITHUB_ENV
42 git ls-files --others >> $GITHUB_ENV
43 echo 'EOF' >> $GITHUB_ENV
44 # cleanup logs of failed updates so they aren't included in the PR
49 uses: peter-evans/create-pull-request@v5
52 Automatic update by [update-terraform-providers](https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/update-terraform-providers.yml) action.
54 https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}
56 These providers failed to update:
61 Check that all providers build with:
63 @ofborg build terraform.full
65 If there is more than ten commits in the PR `ofborg` won't build it automatically and you will need to use the above command.
66 branch: terraform-providers-update
68 title: ${{ steps.setup.outputs.title }}
69 token: ${{ secrets.GITHUB_TOKEN }}