Skip to content

Commit 880fe52

Browse files
committed
Improving GitHub Action to mention the related PR
1 parent b46d93a commit 880fe52

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,47 @@ jobs:
1111
steps:
1212
- name: Checkout Repo
1313
uses: actions/checkout@master
14-
- name: Get the list of modified files only
14+
- name: Get the list of modified installers only
1515
uses: technote-space/get-diff-action@v1
1616
with:
1717
PREFIX_FILTER: |
1818
installers
1919
- name: Generate installers, update README.md & installers.toml
20-
run: ./generate.sh ${{ env.GIT_DIFF }}
2120
if: env.GIT_DIFF
21+
run: ./generate.sh ${{ env.GIT_DIFF }}
2222
- name: Minify generated installers
23+
if: env.GIT_DIFF
2324
run: ./minify.sh ${{ env.GIT_DIFF }}
25+
- name: Find the Related PR
2426
if: env.GIT_DIFF
27+
uses: jwalton/gh-find-current-pr@v1
28+
id: findPr
29+
with:
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Related PR
32+
if: env.GIT_DIFF && success() && steps.findPr.outputs.number
33+
id: vars
34+
run: |
35+
echo "The related PR is ${PR}"
36+
echo ::set-output name=pr_body::"#${PR}"
37+
env:
38+
PR: ${{ steps.findPr.outputs.pr }}
2539
- name: Create a pull request for README.md & installers.toml updates
40+
if: env.GIT_DIFF
2641
uses: peter-evans/create-pull-request@v3
2742
with:
2843
commit-message: update README.md & installers.toml
29-
title: Update README.md & installers.toml
30-
body: Update README.md & installers.toml for the changes to the installer scripts
44+
title: Update installer scrits, README.md & installers.toml
45+
body: |
46+
Update README.md & installers.toml for the changes to the installer scripts.
47+
This is a generated PR in related to PR ${{ steps.vars.outputs.pr_body }}
3148
branch: update-readme-md-and-installers-toml
32-
if: env.GIT_DIFF
3349
- name: Archive Production Artifact
50+
if: env.GIT_DIFF
3451
uses: actions/upload-artifact@master
3552
with:
3653
name: installers
3754
path: installers
38-
if: env.GIT_DIFF
3955

4056
deploy:
4157
name: Deploy
@@ -44,11 +60,17 @@ jobs:
4460
steps:
4561
- name: Checkout Repo
4662
uses: actions/checkout@master
63+
- name: Get the list of modified installers only
64+
uses: technote-space/get-diff-action@v1
65+
with:
66+
PREFIX_FILTER: |
67+
installers
4768
- name: Download Artifact
4869
uses: actions/download-artifact@master
4970
with:
5071
name: installers
5172
path: installers
73+
if: env.GIT_DIFF
5274
- name: Install Dependencies
5375
run: cd functions && npm install
5476
- name: Deploy to Firebase

0 commit comments

Comments
 (0)