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

Commit 733c422

Browse files
chore: add --slient to curls, use secrets and some fixies (#13)
Signed-off-by: Matheus Ferreira <matheus.ferreira@zup.com.br> Signed-off-by: Matheus Ferreira <matheus.ferreira@zup.com.br>
1 parent 03ed9db commit 733c422

File tree

5 files changed

+20
-48
lines changed

5 files changed

+20
-48
lines changed

.github/workflows/check-callback.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
CHECK_CALLBACK:
2525
runs-on: ubuntu-latest
2626
steps:
27-
2827
- name: Callback - ${{ github.event.client_payload.state }}
2928
if: contains(fromJson('["pending", "success", "failure"]'), github.event.client_payload.state)
3029
run: |
@@ -33,14 +32,14 @@ jobs:
3332
-u '${{ secrets.ACCESS_TOKEN }}' \
3433
--header 'content-type: application/vnd.github+json' \
3534
-o result.json \
35+
--silent \
3636
--data '{
3737
"context": "${{ github.event.action }} - Check callback",
3838
"state": "${{ github.event.client_payload.state }}",
3939
"description": "${{ github.event.client_payload.description }}",
4040
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
4141
}'
4242
43-
4443
- name: Intenal error ❌
4544
if: ${{ failure() && github.event.client_payload.state != 'failure'}}
4645
run: |
@@ -49,6 +48,7 @@ jobs:
4948
-u '${{ secrets.ACCESS_TOKEN }}' \
5049
--header 'content-type: application/vnd.github+json' \
5150
-o error.json \
51+
--silent \
5252
--data '{
5353
"context": "${{ github.event.action }} - Check callback",
5454
"state": "error",

.github/workflows/deploy-pre-release.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,29 @@
1414
# limitations under the License.
1515
#
1616

17-
name: Deploy production
17+
name: Deploy pre release
1818

1919
on:
2020
push:
2121
branches:
2222
- release-*
2323

2424
jobs:
25-
RELEASE:
25+
DISPATCH_EVENT:
2626
runs-on: ubuntu-latest
2727
steps:
28-
- name: Change to pending status
29-
run: |
30-
curl --request POST \
31-
--url ${{ github.event.pull_request._links.statuses.href}} \
32-
-u '${{ secrets.ACCESS_TOKEN }}' \
33-
--header 'content-type: application/vnd.github+json' \
34-
-o result.json \
35-
--data '{
36-
"context": "RELEASE - Check callback",
37-
"state": "pending",
38-
"description": "Waiting to start",
39-
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
40-
}'
41-
4228
- name: Dispatch init event
4329
run: |
44-
curl -X POST https://api.github.com/repos/stack-spot/stackspot-intellij-plugin/dispatches \
30+
REPO_NAME=${{ secrets.INTERNAL_REPO_NAME }}
31+
curl -X POST https://api.github.com/repos/$REPO_NAME/dispatches \
4532
-H 'Accept: application/vnd.github.everest-preview+json' \
4633
-u ${{ secrets.ACCESS_TOKEN }} \
4734
-o response.json \
35+
--silent \
4836
--data '{
4937
"event_type": "RELEASE",
5038
"client_payload": {
5139
"ref": "${{ github.ref }}",
52-
"ref_name": "${{ github.ref_name }}",
53-
"repository_owner": "${{ github.repository_owner }}",
54-
"repository_name": "${{ github.event.repository.name }}",
55-
"statuses_href": "${{ github.event.pull_request._links.statuses.href}}"
40+
"statuses_href": "${{ github.event.repository.statuses_url}}"
5641
}
5742
}'

.github/workflows/deploy-prod.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,25 @@ name: Deploy production
1818

1919
on:
2020
push:
21-
branches:
21+
tags:
2222
- v*.*.*
2323

2424
jobs:
25-
VERSION:
25+
DISPATCH_EVENT:
2626
runs-on: ubuntu-latest
2727
steps:
28-
- name: Change to pending status
29-
run: |
30-
curl --request POST \
31-
--url ${{ github.event.pull_request._links.statuses.href}} \
32-
-u '${{ secrets.ACCESS_TOKEN }}' \
33-
--header 'content-type: application/vnd.github+json' \
34-
-o result.json \
35-
--data '{
36-
"context": "TAG - Check callback",
37-
"state": "pending",
38-
"description": "Waiting to start",
39-
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
40-
}'
41-
4228
- name: Dispatch init event
4329
run: |
44-
curl -X POST https://api.github.com/repos/stack-spot/stackspot-intellij-plugin/dispatches \
30+
REPO_NAME=${{ secrets.INTERNAL_REPO_NAME }}
31+
curl -X POST https://api.github.com/repos/$REPO_NAME/dispatches \
4532
-H 'Accept: application/vnd.github.everest-preview+json' \
4633
-u ${{ secrets.ACCESS_TOKEN }} \
34+
-o response.json \
35+
--silent \
4736
--data '{
4837
"event_type": "TAG",
4938
"client_payload": {
5039
"ref": "${{ github.ref }}",
51-
"ref_name": "${{ github.ref_name }}",
52-
"repository_owner": "${{ github.repository_owner }}",
53-
"repository_name": "${{ github.event.repository.name }}",
54-
"statuses_href": "${{ github.event.pull_request._links.statuses.href}}"
40+
"statuses_href": "${{ github.event.repository.statuses_url}}"
5541
}
5642
}'

.github/workflows/header-license-check.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ permissions: read-all
2929
jobs:
3030
HEADER_LICENSE_CHECK:
3131
runs-on: ubuntu-latest
32-
3332
steps:
3433
- uses: actions/checkout@v3
3534
- name: Check License and license year on prs

.github/workflows/security-pipeline.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
-u '${{ secrets.ACCESS_TOKEN }}' \
3131
--header 'content-type: application/vnd.github+json' \
3232
-o result.json \
33+
--silent \
3334
--data '{
3435
"context": "SECURITY - Check callback",
3536
"state": "pending",
@@ -39,9 +40,11 @@ jobs:
3940
4041
- name: Dispatch init event
4142
run: |
42-
curl -X POST https://api.github.com/repos/stack-spot/stackspot-intellij-plugin/dispatches \
43+
REPO_NAME=${{ secrets.INTERNAL_REPO_NAME }}
44+
curl -X POST https://api.github.com/repos/$REPO_NAME/dispatches \
4345
-H 'Accept: application/vnd.github.everest-preview+json' \
4446
-u ${{ secrets.ACCESS_TOKEN }} \
47+
--silent \
4548
--data '{
4649
"event_type": "SECURITY",
4750
"client_payload": {
@@ -51,5 +54,4 @@ jobs:
5154
"repository_name": "${{ github.event.repository.name }}",
5255
"statuses_href": "${{ github.event.pull_request._links.statuses.href}}"
5356
}
54-
}'
55-
57+
}'

0 commit comments

Comments
 (0)