summary refs log tree commit diff
path: root/.github/workflows/update-terraform-providers.yml
blob: 09d208a621603158d1b4309da5df405f95e321a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: "Update terraform-providers"

on:
  schedule:
    - cron: "14 3 * * 1"
  workflow_dispatch:

jobs:
  tf-providers:
    if: github.repository_owner == 'NixOS' && github.ref == 'refs/heads/master' # ensure workflow_dispatch only runs on master
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: cachix/install-nix-action@v16
      - 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
          ./update-all-providers --no-build
          git commit -m "${{ steps.setup.outputs.title }}" providers.json
          popd
      - name: create PR
        uses: peter-evans/create-pull-request@v3
        with:
          body: |
            Automatic update of terraform providers.

            Created by [update-terraform-providers](https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/update-terraform-providers.yml) action.

            Check that all providers build with `@ofborg build terraform-full`
          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
        uses: peter-evans/create-or-update-comment@v1
        if: ${{ failure() }}
        with:
          issue-number: 153416
          body: |
            Automatic update of terraform providers [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).