-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub Actions workflows. (#1317)
This PR was automatically generated by the update-workflows-ecosystem-providers workflow in the pulumi/ci-mgmt repo, from commit f96fe3787b1f8929df4710c19ce2bb436777adce.
- Loading branch information
1 parent
692d2c2
commit d5cbb53
Showing
1 changed file
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,9 @@ jobs: | |
name: build_sdk | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
# We normally fail fast unless this is a PR from Renovate in which case | ||
# we'll always build all SDKs in case there are any changes to commit. | ||
fail-fast: ${{ ! contains(github.actor, 'renovate') }} | ||
matrix: | ||
language: | ||
- nodejs | ||
|
@@ -83,14 +85,52 @@ jobs: | |
- name: Build SDK | ||
run: make build_${{ matrix.language }} | ||
- name: Check worktree clean | ||
id: worktreeClean | ||
uses: pulumi/git-status-check-action@v1 | ||
with: | ||
# Keep these in sync with the Renovate step below to avoid them getting checked in. | ||
allowed-changes: | | ||
sdk/**/pulumi-plugin.json | ||
sdk/dotnet/*.csproj | ||
sdk/go/**/pulumiUtilities.go | ||
sdk/nodejs/package.json | ||
sdk/python/pyproject.toml | ||
- name: Commit ${{ matrix.language }} SDK changes for Renovate | ||
# If the worktree is dirty and this is a Renovate PR to bump | ||
# dependencies, commit the updated SDK and push it back to the PR. The | ||
# job will still be marked as a failure. | ||
if: failure() && steps.worktreeClean.outcome == 'failure' && contains(github.actor, 'renovate') | ||
shell: bash | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "pulumi-bot" | ||
# Stash local changes and check out the PR's branch directly. | ||
git stash | ||
git fetch | ||
git checkout "origin/$HEAD_REF" | ||
# Apply and add our changes, but don't commit any files we expect to | ||
# always change due to versioning. | ||
git stash pop | ||
git add sdk | ||
git reset \ | ||
sdk/python/*/pulumi-plugin.json \ | ||
sdk/dotnet/Pulumi.*.csproj \ | ||
sdk/go/*/internal/pulumiUtilities.go \ | ||
sdk/nodejs/package.json \ | ||
sdk/python/pyproject.toml | ||
git commit -m 'Commit ${{ matrix.language }} SDK for Renovate' | ||
# Push with pulumi-bot credentials to trigger a re-run of the | ||
# workflow. https://github.com/orgs/community/discussions/25702 | ||
git push https://pulumi-bot:${{ secrets.PULUMI_BOT_TOKEN }}@github.com/${{ github.repository }} \ | ||
"HEAD:$HEAD_REF" | ||
env: | ||
# head_ref is untrusted so it's recommended to pass via env var to | ||
# avoid injections. | ||
HEAD_REF: ${{ github.head_ref }} | ||
|
||
- name: Upload SDK | ||
uses: ./.github/actions/upload-sdk | ||
with: | ||
|