|
5 | 5 | types: [created]
|
6 | 6 |
|
7 | 7 | jobs:
|
8 |
| - # output-context: |
| 8 | + # get-pr-branch-name: |
9 | 9 | # runs-on: ubuntu-latest
|
| 10 | + # outputs: |
| 11 | + # branchName: ${{ steps.get-pr-branch-name.outputs.branchName }} |
10 | 12 | # steps:
|
11 |
| - # - name: Dump GitHub context |
12 |
| - # env: |
13 |
| - # GITHUB_CONTEXT: ${{ toJSON(github) }} |
14 |
| - # run: echo "$GITHUB_CONTEXT" |
15 |
| - # - name: Dump job context |
16 |
| - # env: |
17 |
| - # JOB_CONTEXT: ${{ toJSON(job) }} |
18 |
| - # run: echo "$JOB_CONTEXT" |
19 |
| - # - name: Dump steps context |
20 |
| - # env: |
21 |
| - # STEPS_CONTEXT: ${{ toJSON(steps) }} |
22 |
| - # run: echo "$STEPS_CONTEXT" |
23 |
| - # - name: Dump runner context |
| 13 | + # - id: get-pr-branch-name |
| 14 | + # run: | |
| 15 | + # branchName=$(gh pr view ${{ github.event.issue.number }} --json "headRefName" --jq ".headRefName" --repo ${{ github.repository }}) |
| 16 | + # echo "branchName=$branchName" >> $GITHUB_OUTPUT |
24 | 17 | # env:
|
25 |
| - # RUNNER_CONTEXT: ${{ toJSON(runner) }} |
26 |
| - # run: echo "$RUNNER_CONTEXT" |
27 |
| - # - name: Dump strategy context |
28 |
| - # env: |
29 |
| - # STRATEGY_CONTEXT: ${{ toJSON(strategy) }} |
30 |
| - # run: echo "$STRATEGY_CONTEXT" |
31 |
| - # - name: Dump matrix context |
32 |
| - # env: |
33 |
| - # MATRIX_CONTEXT: ${{ toJSON(matrix) }} |
34 |
| - # run: echo "$MATRIX_CONTEXT" |
| 18 | + # GH_TOKEN: ${{ github.token }} |
35 | 19 |
|
36 | 20 | get-pr-branch-name:
|
37 |
| - runs-on: ubuntu-latest |
38 |
| - outputs: |
39 |
| - branchName: ${{ steps.get-pr-branch-name.outputs.branchName }} |
40 |
| - steps: |
41 |
| - - id: get-pr-branch-name |
42 |
| - run: | |
43 |
| - branchName=$(gh pr view ${{ github.event.issue.number }} --json "headRefName" --jq ".headRefName" --repo ${{ github.repository }}) |
44 |
| - echo "branchName=$branchName" >> $GITHUB_OUTPUT |
45 |
| - env: |
46 |
| - GH_TOKEN: ${{ github.token }} |
| 21 | + uses: ./.github/workflows/util-get-pr-branch-name.yaml |
| 22 | + with: |
| 23 | + pullRequestNumber: ${{ github.event.issue.number }} |
47 | 24 |
|
48 | 25 | pre-deploy:
|
49 | 26 | # check if the comment comes from a pull request and contains the required keyword
|
|
59 | 36 | # check if the comment comes from a pull request and contains the required keyword
|
60 | 37 | if: contains(github.event.comment.html_url, '/pull/') && contains(github.event.comment.body, '/deploy')
|
61 | 38 | needs: [get-pr-branch-name, pre-deploy]
|
62 |
| - uses: ./.github/workflows/shared-build-and-deploy.yaml |
| 39 | + uses: ./.github/workflows/util-build-and-deploy.yaml |
63 | 40 | with:
|
64 | 41 | deploy: true
|
65 | 42 | branchName: ${{ needs.get-pr-branch-name.outputs.branchName }}
|
|
70 | 47 | needs: deploy
|
71 | 48 | steps:
|
72 | 49 | - run: |
|
73 |
| - gh issue comment ${{ github.event.issue.number }} --body "Preview environment deployed: https://${{ needs.deploy.outputs.container-app-url }}" --repo ${{ github.repository }} |
| 50 | + gh issue comment ${{ github.event.issue.number }} --body "Preview environment deployed: https://${{ needs.deploy.outputs.containerAppUrl }}" --repo ${{ github.repository }} |
74 | 51 | env:
|
75 | 52 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 53 | +
|
| 54 | + # output-context: |
| 55 | + # runs-on: ubuntu-latest |
| 56 | + # steps: |
| 57 | + # - name: Dump GitHub context |
| 58 | + # env: |
| 59 | + # GITHUB_CONTEXT: ${{ toJSON(github) }} |
| 60 | + # run: echo "$GITHUB_CONTEXT" |
| 61 | + # - name: Dump job context |
| 62 | + # env: |
| 63 | + # JOB_CONTEXT: ${{ toJSON(job) }} |
| 64 | + # run: echo "$JOB_CONTEXT" |
| 65 | + # - name: Dump steps context |
| 66 | + # env: |
| 67 | + # STEPS_CONTEXT: ${{ toJSON(steps) }} |
| 68 | + # run: echo "$STEPS_CONTEXT" |
| 69 | + # - name: Dump runner context |
| 70 | + # env: |
| 71 | + # RUNNER_CONTEXT: ${{ toJSON(runner) }} |
| 72 | + # run: echo "$RUNNER_CONTEXT" |
| 73 | + # - name: Dump strategy context |
| 74 | + # env: |
| 75 | + # STRATEGY_CONTEXT: ${{ toJSON(strategy) }} |
| 76 | + # run: echo "$STRATEGY_CONTEXT" |
| 77 | + # - name: Dump matrix context |
| 78 | + # env: |
| 79 | + # MATRIX_CONTEXT: ${{ toJSON(matrix) }} |
| 80 | + # run: echo "$MATRIX_CONTEXT" |
0 commit comments