diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e939215c7..ff5f17006 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -121,14 +121,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Extract variables shell: bash run: | echo "::set-output name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" echo "::set-output name=TAG::$(git tag --points-at HEAD)" echo "::set-output name=GIT_SHA::$(git rev-parse HEAD)" - echo "::set-output name=GIT_SHA_SHORT::$(git rev-parse --short HEAD)" + echo "::set-output name=GIT_SHA_SHORT::$(git rev-parse --short HEAD)" + echo "::set-output name=MESSAGE::$(git log --format=%B -n 1 ${{ github.event.after }})" id: extract_variables - name: Checkout terraform config repo @@ -168,7 +170,7 @@ jobs: text: 'A new version of the is been deployed to stage.' failure_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) build failed' fields: | - [{ "title": "Commit message", "value": "${{ github.event.head_commit.message }}" }, + [{ "title": "Commit message", "value": "${{ steps.extract_variables.outputs.MESSAGE }}" }, { "title": "Committed by", "value": "", "short": true }, { "title": "Commit SHA", "value": "", "short": true }, { "title": "Repository", "value": "", "short": true }, diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 55e857cea..d7012598b 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -46,8 +46,6 @@ jobs: AWS_REGION: ${{ secrets.AWS_REGION }} steps: - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - name: Set up Ruby 2.6 uses: actions/setup-ruby@v1 with: