|
38 | 38 | BUILD_CACHE_KEY: ${{ github.event.inputs.commit || github.sha }}
|
39 | 39 |
|
40 | 40 | jobs:
|
41 |
| - job_install_deps: |
42 |
| - name: Install Dependencies |
| 41 | + job_get_metadata: |
| 42 | + name: Get Commit metadata |
43 | 43 | runs-on: ubuntu-latest
|
44 |
| - timeout-minutes: 15 |
45 | 44 | steps:
|
46 |
| - - name: Check out current commit (${{ env.HEAD_COMMIT }}) |
| 45 | + - name: Check out current commit |
47 | 46 | uses: actions/checkout@v2
|
48 | 47 | with:
|
49 | 48 | ref: ${{ env.HEAD_COMMIT }}
|
50 | 49 | # We need to check out not only the fake merge commit between the PR and the base branch which GH creates, but
|
51 | 50 | # also its parents, so that we can pull the commit message from the head commit of the PR
|
52 | 51 | fetch-depth: 2
|
53 |
| - # - name: Get PR head SHA |
54 |
| - # run: echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV |
55 |
| - # - name: Setup tmate session |
56 |
| - # uses: mxschmitt/action-tmate@v3 |
57 | 52 | - name: Get metadata
|
58 | 53 | id: get_metadata
|
59 | 54 | run: |
|
60 | 55 | COMMIT_SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})
|
61 | 56 | COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%s ${{ github.event.pull_request.head.sha }})
|
62 |
| - echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV |
63 | 57 | echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
|
| 58 | + echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV |
| 59 | + echo "::set-output name=commit_sha::$COMMIT_SHA" |
64 | 60 | echo "::set-output name=commit_message::$COMMIT_MESSAGE"
|
65 |
| - # - name: "BRANCH: ${{ github.ref_name }}" |
66 |
| - # run: echo "" |
| 61 | + outputs: |
| 62 | + commit_sha: ${{ steps.get_metadata.outputs.commit_sha }} |
| 63 | + commit_message: ${{ steps.get_metadata.outputs.commit_message }} |
| 64 | + |
| 65 | + job_install_deps: |
| 66 | + name: Install Dependencies |
| 67 | + needs: job_get_metadata |
| 68 | + runs-on: ubuntu-latest |
| 69 | + timeout-minutes: 15 |
| 70 | + steps: |
| 71 | + - name: Check out current commit (${{ needs.job_install_deps.outputs.commit_sha }} -${{ needs.job_install_deps.outputs.commit_message }}) |
| 72 | + uses: actions/checkout@v2 |
| 73 | + with: |
| 74 | + ref: ${{ env.HEAD_COMMIT }} |
| 75 | + # # - name: Get PR head SHA |
| 76 | + # # run: echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV |
| 77 | + # # - name: Setup tmate session |
| 78 | + # # uses: mxschmitt/action-tmate@v3 |
| 79 | + # - name: Get metadata |
| 80 | + # id: get_metadata |
| 81 | + # run: | |
| 82 | + # COMMIT_SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha }}) |
| 83 | + # COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%s ${{ github.event.pull_request.head.sha }}) |
| 84 | + # echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV |
| 85 | + # echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV |
| 86 | + # echo "::set-output name=commit_message::$COMMIT_MESSAGE" |
| 87 | + # # - name: "BRANCH: ${{ github.ref_name }}" |
| 88 | + # # run: echo "" |
67 | 89 | - name: "CURRENT COMMIT: ${{ env.COMMIT_SHA }} - ${{ env.COMMIT_MESSAGE }}"
|
68 | 90 | run: echo ""
|
69 | 91 | # - name: "SHA: ${{ github.sha }}"
|
|
0 commit comments