Update first-party Pulumi dependencies #3086
This file contains hidden or 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
| env: | |
| ESC_ACTION_OIDC_AUTH: true | |
| ESC_ACTION_OIDC_ORGANIZATION: pulumi | |
| ESC_ACTION_OIDC_REQUESTED_TOKEN_TYPE: urn:pulumi:token-type:access_token:organization | |
| ESC_ACTION_ENVIRONMENT: imports/github-secrets | |
| ESC_ACTION_EXPORT_ENVIRONMENT_VARIABLES: false | |
| # In TypeScript actions, `dist/` is a special directory. When you reference | |
| # an action with the `uses:` property, `dist/index.js` is the code that will be | |
| # run. For this project, the `dist/index.js` file is transpiled from other | |
| # source files. This workflow ensures the `dist/` directory contains the | |
| # expected transpiled code. | |
| # | |
| # If this workflow is run from a feature branch, it will act as an additional CI | |
| # check and fail if the checked-in `dist/` directory does not match what is | |
| # expected from the build. | |
| name: Check Transpiled JavaScript | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| check-dist: | |
| name: Check dist/ | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch secrets from ESC | |
| id: esc-secrets | |
| uses: pulumi/esc-action@32dda43ffe7a2ab21e6bce11c781b44a3e5623cf # v3 | |
| - name: Checkout | |
| id: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| with: | |
| # Check out the PR branch rather than the merge commit so we're able to push changes back. | |
| ref: ${{ github.event.pull_request.head.ref || github.sha }} | |
| persist-credentials: false # Needed in order to not use ambient GITHUB_TOKEN when pushing. | |
| - name: Setup Node.js | |
| id: setup-node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| - name: Install Dependencies | |
| id: install | |
| run: npm ci | |
| - name: Build dist/ Directory | |
| id: build | |
| run: npm run bundle | |
| - name: Compare Directories | |
| id: diff | |
| run: | | |
| if [ ! -d dist/ ]; then | |
| echo "Expected dist/ directory does not exist. See status below:" | |
| ls -la ./ | |
| exit 1 | |
| fi | |
| if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then | |
| echo "Detected uncommitted changes after build. See status below:" | |
| git diff --ignore-space-at-eol --text dist/ | |
| exit 1 | |
| fi | |
| - if: | |
| ${{ failure() && steps.diff.outcome == 'failure' && | |
| !contains(github.actor, 'pulumi-bot') }} | |
| name: Upload Artifact | |
| id: upload | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - if: | |
| ${{ failure() && steps.diff.outcome == 'failure' && github.event_name | |
| == 'pull_request' && !contains(github.actor, 'pulumi-bot') }} | |
| name: Push updated build | |
| run: | | |
| git config --global user.name pulumi-bot | |
| git config --global user.email bot@pulumi.com | |
| git add dist/ | |
| git commit -m "Rebuild dist" | |
| # 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 }} |