Skip to content

Commit f3298e5

Browse files
ci: PLT-506: Follow Merge v2
1 parent d7bac84 commit f3298e5

File tree

5 files changed

+366
-47
lines changed

5 files changed

+366
-47
lines changed

.github/workflows/feature-flags-update.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ jobs:
2929
steps:
3030
- uses: hmarr/debug-action@v3.0.0
3131

32+
- name: Add Workflow link to chat ops command comment
33+
if: github.event.client_payload.github.payload.comment.id && github.event.client_payload.github.payload.repository.full_name
34+
uses: peter-evans/create-or-update-comment@v4
35+
with:
36+
token: ${{ secrets.GIT_PAT }}
37+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
38+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
39+
body: |
40+
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
41+
3242
- name: Configure git
3343
shell: bash
3444
run: |
@@ -68,3 +78,12 @@ jobs:
6878
git status -s
6979
git commit -m '${{ env.FEATURE_FLAGS_COMMIT_MESSAGE }}' -m 'Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' || true
7080
git push origin HEAD
81+
82+
- name: Add reaction to chat ops command comment
83+
if: always() && github.event.client_payload.github.payload.comment.id && github.event.client_payload.github.payload.repository.full_name
84+
uses: peter-evans/create-or-update-comment@v4
85+
with:
86+
token: ${{ secrets.GIT_PAT }}
87+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
88+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
89+
reactions: ${{ job.status == 'success' && '+1' || '-1' }}

.github/workflows/ff-command.yml

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,14 @@ concurrency:
88
group: ${{ github.workflow }}-${{ github.event.client_payload.github.payload.issue.number }}-${{ github.event.client_payload.slash_command.command }}-${{ github.event.client_payload.slash_command.args.unnamed.arg1 || github.event.client_payload.slash_command.args.all }}
99

1010
jobs:
11-
12-
update-prepare:
13-
name: "Update: Prepare"
14-
if: github.event.client_payload.slash_command.args.unnamed.arg1 == 'update'
15-
runs-on: ubuntu-latest
16-
timeout-minutes: 1
17-
steps:
18-
- name: Update comment
19-
uses: peter-evans/create-or-update-comment@v4
20-
with:
21-
token: ${{ secrets.GIT_PAT }}
22-
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
23-
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
24-
body: |
25-
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
26-
27-
update-update-ff:
11+
update-ff:
2812
name: "Update: Update Feature Flags"
2913
if: github.event.client_payload.slash_command.args.unnamed.arg1 == 'update'
30-
needs:
31-
- update-prepare
3214
uses: ./.github/workflows/feature-flags-update.yml
3315
with:
3416
ref: ${{ github.event.client_payload.pull_request.head.ref }}
3517
secrets: inherit
3618

37-
update-update-comment:
38-
name: "Update: Update Comment"
39-
if: always()
40-
needs:
41-
- update-update-ff
42-
runs-on: ubuntu-latest
43-
timeout-minutes: 1
44-
steps:
45-
- name: Get details
46-
id: details
47-
shell: bash
48-
env:
49-
PR_HEAD: ${{ github.event.client_payload.pull_request.head.ref }}
50-
run: |
51-
reaction='-1'
52-
if [[ '${{ needs.update-update-ff.result }}' == 'success' ]]; then
53-
reaction='+1'
54-
fi
55-
echo "reaction=${reaction}" >> $GITHUB_OUTPUT
56-
57-
- name: Update comment
58-
uses: peter-evans/create-or-update-comment@v4
59-
with:
60-
token: ${{ secrets.GIT_PAT }}
61-
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
62-
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
63-
reactions: ${{ steps.details.outputs.reaction }}
64-
6519
help:
6620
if: ${{ github.event.client_payload.slash_command.args.unnamed.arg1 == 'help' || !contains(fromJson('["update"]'), github.event.client_payload.slash_command.args.unnamed.arg1) }}
6721
runs-on: ubuntu-latest

.github/workflows/fm-command.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "/fm command"
2+
3+
on:
4+
repository_dispatch:
5+
types: [ fm-command ]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.client_payload.github.payload.issue.number }}-${{ github.event.client_payload.slash_command.command }}-${{ github.event.client_payload.slash_command.args.unnamed.arg1 || github.event.client_payload.slash_command.args.all }}
9+
10+
jobs:
11+
sync:
12+
name: "Update: Update Feature Flags"
13+
if: github.event.client_payload.slash_command.args.unnamed.arg1 == 'sync'
14+
uses: ./.github/workflows/follow-merge-upstream-repo-sync-v2.yml
15+
with:
16+
branch_name: ${{ github.event.client_payload.pull_request.head.ref }}
17+
secrets: inherit
18+
19+
help:
20+
if: ${{ github.event.client_payload.slash_command.args.unnamed.arg1 == 'help' || !contains(fromJson('["sync"]'), github.event.client_payload.slash_command.args.unnamed.arg1) }}
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 1
23+
steps:
24+
- name: Update comment
25+
uses: peter-evans/create-or-update-comment@v4
26+
with:
27+
token: ${{ secrets.GIT_PAT }}
28+
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
29+
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
30+
body: |
31+
> Command | Description
32+
> --- | ---
33+
> /fm sync | Sync upstream prs and merge with pull request base
34+
reaction-type: hooray

0 commit comments

Comments
 (0)