Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

Commit fb638b0

Browse files
Bug Fix: Added the letter s in the type of callback workflows and changed the plugin's publishing workflow to receive payload variables (#27)
Signed-off-by: Adroaldo Neto <adroaldo.neto@zup.com.br> Signed-off-by: Adroaldo Neto <adroaldo.neto@zup.com.br> Co-authored-by: Adroaldo Neto <adroaldo.neto@zup.com.br> Co-authored-by: adroaldonetozup <68242531+adroaldonetozup@users.noreply.github.com>
1 parent d335be4 commit fb638b0

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

.github/workflows/check-callback.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ jobs:
2727
name: Check Callback
2828
runs-on: ubuntu-latest
2929
steps:
30+
3031
- name: Check state - ${{ github.event.client_payload.state }}
3132
id: check_state
3233
if: |
3334
!contains(fromJson('["pending", "success", "failure"]'), github.event.client_payload.state)
3435
run: |
3536
echo "Invalid state"
3637
exit 1
38+
3739
- name: Callback - ${{ github.event.client_payload.state }}
3840
if: contains(fromJson('["pending", "success", "failure"]'), github.event.client_payload.state)
3941
run: |
@@ -49,6 +51,7 @@ jobs:
4951
"description": "${{ github.event.client_payload.description }}",
5052
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
5153
}'
54+
5255
- name: Internal error ❌
5356
if: failure()
5457
run: |

.github/workflows/deploy-prod.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
"event_type": "RELEASED",
3939
"client_payload": {
4040
"ref": "${{ github.ref }}",
41-
"statuses_href": "'"$STATUSES_HREF"'"
41+
"statuses_href": "'"$STATUSES_HREF"'",
42+
"release_body": "${{ github.event.release.body }}",
43+
"tag_name": "${{ github.event.release.tag_name }}",
44+
"target_commitish": "${{ github.event.release.target_commitish }}"
4245
}
4346
}'

.github/workflows/prereleased.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name: Pre released
1818

1919
on:
2020
repository_dispatch:
21-
type: [RELEASE]
21+
types: [RELEASE]
2222

2323
jobs:
2424
check_callback:

.github/workflows/publish-marketplace.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
id: properties
4343
run: |
4444
CHANGELOG="$(cat << 'EOM' | sed -e "/## What's Changed/d" -e 's/^[[:space:]]*$//g' -e '/./,$!d'
45-
${{ github.event.release.body }}
45+
${{ github.event.client_payload.release_body }}
4646
EOM
4747
)"
4848
@@ -63,15 +63,15 @@ jobs:
6363
- name: Checkout
6464
uses: actions/checkout@v3
6565
with:
66-
ref: ${{ github.event.release.tag_name }}
66+
ref: ${{ github.event.client_payload.tag_name }}
6767

6868
# Publish the plugin to the Marketplace
6969
- name: Publish Plugin
7070
env:
7171
PUBLISH_TOKEN: ${{ secrets.publishToken }}
7272
MARKETPLACE_CHANNEL: ${{ secrets.marketplaceChannel }}
7373
run: |
74-
TAG=${{ github.event.release.tag_name }}
74+
TAG=${{ github.event.client_payload.tag_name }}
7575
TAG="${TAG//v/""}"
7676
./gradlew publishPlugin -Dproject_version=$TAG
7777
@@ -80,7 +80,7 @@ jobs:
8080
env:
8181
GITHUB_TOKEN: ${{ secrets.accessToken }}
8282
run: |
83-
gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
83+
gh release upload ${{ github.event.client_payload.tag_name }} ./build/distributions/*
8484
8585
changelog:
8686
name: Changelog
@@ -92,7 +92,7 @@ jobs:
9292
- name: Checkout
9393
uses: actions/checkout@v3
9494
with:
95-
ref: ${{ github.event.release.tag_name }}
95+
ref: ${{ github.event.client_payload.tag_name }}
9696

9797
# Update Unreleased section with the current release note
9898
- name: Patch Changelog
@@ -108,7 +108,7 @@ jobs:
108108
env:
109109
GITHUB_TOKEN: ${{ secrets.accessToken }}
110110
run: |
111-
VERSION="${{ github.event.release.tag_name }}"
111+
VERSION="${{ github.event.client_payload.tag_name }}"
112112
BRANCH="changelog-update-$VERSION"
113113
114114
git config user.email "action@github.com"
@@ -121,6 +121,6 @@ jobs:
121121
gh pr create \
122122
--title "Changelog update - \`$VERSION\`" \
123123
--body "current pull request contains patched \`changelog.md\` file for the \`$version\` version." \
124-
--base "${{ github.event.release.target_commitish }}" \
124+
--base "${{ github.event.client_payload.target_commitish }}" \
125125
--head $BRANCH \
126126
--label ignore-for-release

.github/workflows/released.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name: Released
1818

1919
on:
2020
repository_dispatch:
21-
type: [RELEASED]
21+
types: [RELEASED]
2222

2323
jobs:
2424
check_callback:
@@ -29,6 +29,7 @@ jobs:
2929

3030
publish:
3131
name: Publish Plugin
32+
if: github.event.client_payload.state == 'success'
3233
needs:
3334
- check_callback
3435
uses: stack-spot/stackspot-intellij-extension/.github/workflows/publish-marketplace.yml@main

.github/workflows/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name: Security
1818

1919
on:
2020
repository_dispatch:
21-
type: [SECURITY]
21+
types: [SECURITY]
2222

2323
jobs:
2424
check_callback:

0 commit comments

Comments
 (0)