Merge pull request #208711 from qowoz/tf-token

terraform-providers: add github token to update-providers

authored by

Jörg Thalheim and committed by
GitHub
3520682a b92e8e59

+5 -3
+4 -2
.github/workflows/update-terraform-providers.yml
··· 11 11 jobs: 12 12 tf-providers: 13 13 permissions: 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, for peter-evans/create-or-update-comment to create or update comment 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, for peter-evans/create-or-update-comment to create or update comment 16 16 if: github.repository_owner == 'NixOS' && github.ref == 'refs/heads/master' # ensure workflow_dispatch only runs on master 17 17 runs-on: ubuntu-latest 18 18 steps: ··· 25 25 run: | 26 26 echo "title=terraform-providers: update $(date -u +"%Y-%m-%d")" >> $GITHUB_OUTPUT 27 27 - name: update terraform-providers 28 + env: 29 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 28 30 run: | 29 31 git config user.email "41898282+github-actions[bot]@users.noreply.github.com" 30 32 git config user.name "github-actions[bot]"
+1 -1
pkgs/applications/networking/cluster/terraform-providers/update-provider
··· 137 137 update_attr repo "${repo}" 138 138 139 139 if [[ ${spdx} == 1 ]]; then 140 - spdx="$(curl -L -s "https://api.github.com/repos/${org}/${repo}/license" | jq -r '.license.spdx_id')" 140 + spdx="$(curl -L -s ${GITHUB_TOKEN:+-u ":${GITHUB_TOKEN}"} "https://api.github.com/repos/${org}/${repo}/license" | jq -r '.license.spdx_id')" 141 141 update_attr spdx "${spdx}" 142 142 fi 143 143