name: Pull Request
on:
  - pull_request

env:
  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  AWS_REGION: "us-west-2"
  AWS_DEFAULT_REGION: "us-west-2"
jobs:
  preview:
    name: Pulumi Preview
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - name: Fetch asdf version
        id: fetch-version
        run: |
          version="$(cat .tool-versions | grep 'pulumi' | awk '{print $2}')"
          echo "::set-output name=version::${version}"

      - run: npm ci
      - name: Install Pulumi
        uses: pulumi/action-install-pulumi-cli@v1.0.1
        with:
          pulumi-version: ${{ steps.fetch-version.outputs.version }}

      - uses: pulumi/actions@v2
        env:
          PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
        with:
          github-token: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
          command: preview
          stack-name: blog
          comment-on-pr: true
          diff: true

name: Pull Request
on:
  - pull_request

env:
  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  AWS_REGION: "us-west-2"
  AWS_DEFAULT_REGION: "us-west-2"
jobs:
  preview:
    name: Pulumi Preview
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - name: Fetch asdf version
        id: fetch-version
        run: |
          version="$(cat .tool-versions | grep 'pulumi' | awk '{print $2}')"
          echo "::set-output name=version::${version}"

      - run: npm ci
      - name: Install Pulumi
        uses: pulumi/action-install-pulumi-cli@v1.0.1
        with:
          pulumi-version: ${{ steps.fetch-version.outputs.version }}

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: "us-west-2"

      - uses: pulumi/actions@v2
        env:
          PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
        with:
          github-token: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
          command: preview
          stack-name: blog
          comment-on-pr: true
          diff: true

Configure AWS credentials like in the example
Configure AWS credentials like in the example
