2022-01-07 04:07:37 +00:00
name : "Update terraform-providers"
on :
schedule :
2022-07-14 12:49:19 +00:00
- cron : "14 3 * * 0"
2022-01-07 04:07:37 +00:00
workflow_dispatch :
2022-07-14 12:49:19 +00:00
permissions :
contents : read
2022-01-07 04:07:37 +00:00
jobs :
tf-providers :
2022-07-14 12:49:19 +00:00
permissions :
contents : write # for peter-evans/create-pull-request to create branch
2022-09-14 18:05:37 +00:00
pull-requests : write # for peter-evans/create-pull-request to create a PR, for peter-evans/create-or-update-comment to create or update comment
2022-01-07 04:07:37 +00:00
if : github.repository_owner == 'NixOS' && github.ref == 'refs/heads/master' # ensure workflow_dispatch only runs on master
runs-on : ubuntu-latest
steps :
2022-03-05 16:20:37 +00:00
- uses : actions/checkout@v3
2022-04-15 01:41:22 +00:00
- uses : cachix/install-nix-action@v17
2022-01-07 04:07:37 +00:00
- name : setup
id : setup
run : |
echo ::set-output name=title::"terraform-providers: update $(date -u +"%Y-%m-%d")"
- name : update terraform-providers
run : |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
pushd pkgs/applications/networking/cluster/terraform-providers
2022-02-10 20:34:41 +00:00
./update-all-providers --no-build
2022-01-07 04:07:37 +00:00
git commit -m "${{ steps.setup.outputs.title }}" providers.json
popd
- name : create PR
2022-04-27 09:35:20 +00:00
uses : peter-evans/create-pull-request@v4
2022-01-07 04:07:37 +00:00
with :
body : |
2022-04-27 09:35:20 +00:00
Automatic update by [update-terraform-providers](https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/update-terraform-providers.yml) action.
2022-01-07 04:07:37 +00:00
2022-04-27 09:35:20 +00:00
Check that all providers build with :
```
2022-08-12 12:06:08 +00:00
@ofborg build terraform.full
2022-04-27 09:35:20 +00:00
```
2022-01-07 04:07:37 +00:00
branch : terraform-providers-update
delete-branch : false
labels : "2.status: work-in-progress"
title : ${{ steps.setup.outputs.title }}
token : ${{ secrets.GITHUB_TOKEN }}
- name : comment on failure
2022-03-30 09:31:56 +00:00
uses : peter-evans/create-or-update-comment@v2
2022-01-07 04:07:37 +00:00
if : ${{ failure() }}
with :
issue-number : 153416
body : |
Automatic update of terraform providers [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).