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

Commit

Permalink
chore: add --slient to curls, use secrets and some fixies (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Matheus Ferreira <matheus.ferreira@zup.com.br>

Signed-off-by: Matheus Ferreira <matheus.ferreira@zup.com.br>
  • Loading branch information
matheusferreirazup authored Aug 26, 2022
1 parent 03ed9db commit 733c422
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-callback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
CHECK_CALLBACK:
runs-on: ubuntu-latest
steps:

- name: Callback - ${{ github.event.client_payload.state }}
if: contains(fromJson('["pending", "success", "failure"]'), github.event.client_payload.state)
run: |
Expand All @@ -33,14 +32,14 @@ jobs:
-u '${{ secrets.ACCESS_TOKEN }}' \
--header 'content-type: application/vnd.github+json' \
-o result.json \
--silent \
--data '{
"context": "${{ github.event.action }} - Check callback",
"state": "${{ github.event.client_payload.state }}",
"description": "${{ github.event.client_payload.description }}",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'
- name: Intenal error ❌
if: ${{ failure() && github.event.client_payload.state != 'failure'}}
run: |
Expand All @@ -49,6 +48,7 @@ jobs:
-u '${{ secrets.ACCESS_TOKEN }}' \
--header 'content-type: application/vnd.github+json' \
-o error.json \
--silent \
--data '{
"context": "${{ github.event.action }} - Check callback",
"state": "error",
Expand Down
27 changes: 6 additions & 21 deletions .github/workflows/deploy-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,29 @@
# limitations under the License.
#

name: Deploy production
name: Deploy pre release

on:
push:
branches:
- release-*

jobs:
RELEASE:
DISPATCH_EVENT:
runs-on: ubuntu-latest
steps:
- name: Change to pending status
run: |
curl --request POST \
--url ${{ github.event.pull_request._links.statuses.href}} \
-u '${{ secrets.ACCESS_TOKEN }}' \
--header 'content-type: application/vnd.github+json' \
-o result.json \
--data '{
"context": "RELEASE - Check callback",
"state": "pending",
"description": "Waiting to start",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'
- name: Dispatch init event
run: |
curl -X POST https://api.github.com/repos/stack-spot/stackspot-intellij-plugin/dispatches \
REPO_NAME=${{ secrets.INTERNAL_REPO_NAME }}
curl -X POST https://api.github.com/repos/$REPO_NAME/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.ACCESS_TOKEN }} \
-o response.json \
--silent \
--data '{
"event_type": "RELEASE",
"client_payload": {
"ref": "${{ github.ref }}",
"ref_name": "${{ github.ref_name }}",
"repository_owner": "${{ github.repository_owner }}",
"repository_name": "${{ github.event.repository.name }}",
"statuses_href": "${{ github.event.pull_request._links.statuses.href}}"
"statuses_href": "${{ github.event.repository.statuses_url}}"
}
}'
28 changes: 7 additions & 21 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,25 @@ name: Deploy production

on:
push:
branches:
tags:
- v*.*.*

jobs:
VERSION:
DISPATCH_EVENT:
runs-on: ubuntu-latest
steps:
- name: Change to pending status
run: |
curl --request POST \
--url ${{ github.event.pull_request._links.statuses.href}} \
-u '${{ secrets.ACCESS_TOKEN }}' \
--header 'content-type: application/vnd.github+json' \
-o result.json \
--data '{
"context": "TAG - Check callback",
"state": "pending",
"description": "Waiting to start",
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}'
- name: Dispatch init event
run: |
curl -X POST https://api.github.com/repos/stack-spot/stackspot-intellij-plugin/dispatches \
REPO_NAME=${{ secrets.INTERNAL_REPO_NAME }}
curl -X POST https://api.github.com/repos/$REPO_NAME/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.ACCESS_TOKEN }} \
-o response.json \
--silent \
--data '{
"event_type": "TAG",
"client_payload": {
"ref": "${{ github.ref }}",
"ref_name": "${{ github.ref_name }}",
"repository_owner": "${{ github.repository_owner }}",
"repository_name": "${{ github.event.repository.name }}",
"statuses_href": "${{ github.event.pull_request._links.statuses.href}}"
"statuses_href": "${{ github.event.repository.statuses_url}}"
}
}'
1 change: 0 additions & 1 deletion .github/workflows/header-license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ permissions: read-all
jobs:
HEADER_LICENSE_CHECK:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Check License and license year on prs
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/security-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
-u '${{ secrets.ACCESS_TOKEN }}' \
--header 'content-type: application/vnd.github+json' \
-o result.json \
--silent \
--data '{
"context": "SECURITY - Check callback",
"state": "pending",
Expand All @@ -39,9 +40,11 @@ jobs:
- name: Dispatch init event
run: |
curl -X POST https://api.github.com/repos/stack-spot/stackspot-intellij-plugin/dispatches \
REPO_NAME=${{ secrets.INTERNAL_REPO_NAME }}
curl -X POST https://api.github.com/repos/$REPO_NAME/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.ACCESS_TOKEN }} \
--silent \
--data '{
"event_type": "SECURITY",
"client_payload": {
Expand All @@ -51,5 +54,4 @@ jobs:
"repository_name": "${{ github.event.repository.name }}",
"statuses_href": "${{ github.event.pull_request._links.statuses.href}}"
}
}'
}'

0 comments on commit 733c422

Please sign in to comment.