Skip to content

Commit 8409eb5

Browse files
committed
[Add] repository dispatch action to notify tag changes in registries
1 parent 29895c3 commit 8409eb5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: McCode Pooch Registries Dispatch
2+
on:
3+
create:
4+
delete:
5+
6+
jobs:
7+
dispatch:
8+
if: github.event.ref_type == 'tag'
9+
name: Dispatch tag
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
repo: ['mccode-dev/mccode-pooch-registries']
14+
timeout-minutes: 5
15+
steps:
16+
- name: Construct creation payload
17+
shell: bash
18+
run: |
19+
echo "${GITHUB_EVENT_NAME}"
20+
REMOVE=$([ "${GITHUB_EVENT_NAME}" == "delete" ] && echo "1" || echo "0" )
21+
echo "REMOVE=${REMOVE}" >> "${GITHUB_ENV}"
22+
echo "TAG=${{ github.event.ref }}" >> "${GITHUB_ENV}"
23+
24+
- name: Repository Dispatch
25+
uses: peter-evans/repository-dispatch@v3
26+
with:
27+
token: ${{ secrets.RECEIVER_TOKEN }}
28+
repository: ${{ matrix.repo }}
29+
event-type: update_tag
30+
client-payload: |-
31+
{
32+
"remove": "${{ env.REMOVE }}",
33+
"tag": "${{ env.TAG }}"
34+
}

0 commit comments

Comments
 (0)