Skip to content

Commit d080536

Browse files
committed
Fix GitHub Actions workflows: standardize runner config and remove duplication
1 parent 7768039 commit d080536

File tree

3 files changed

+90
-34
lines changed

3 files changed

+90
-34
lines changed

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
secrets_scan:
14+
name: Secrets scan
15+
uses: ./.github/workflows/secrets-scan.yml
16+
secrets: inherit
17+
18+
notify_slack_success:
19+
name: Notify success status to Slack
20+
runs-on: ubuntu-latest
21+
if: success() && github.ref == 'refs/heads/master' && github.event_name == 'push'
22+
needs: [secrets_scan]
23+
permissions:
24+
actions: read
25+
contents: read
26+
id-token: write
27+
steps:
28+
- name: GSM Secrets
29+
id: secrets_manager
30+
uses: toptal/actions/gsm-secrets@main
31+
with:
32+
workload_identity_provider: projects/858873486241/locations/global/workloadIdentityPools/gha-pool/providers/github-com
33+
service_account: [email protected]
34+
secrets_name: |-
35+
SLACK_MARKETING_TOOLS_2_RELEASES_WEBHOOK:toptal-ci/SLACK_MARKETING_TOOLS_2_RELEASES_WEBHOOK
36+
SLACK_TEST_PUB_BOT_WEBHOOK:toptal-ci/SLACK_TEST_PUB_BOT_WEBHOOK
37+
38+
- name: Parse secrets
39+
id: parse_secrets
40+
uses: toptal/actions/expose-json-outputs@main
41+
with:
42+
json: ${{ steps.secrets_manager.outputs.secrets }}
43+
44+
- uses: toptal/slack-workflow-status@master
45+
with:
46+
repo_token: ${{ secrets.GITHUB_TOKEN }}
47+
slack_webhook_url: ${{ steps.parse_secrets.outputs.SLACK_MARKETING_TOOLS_2_RELEASES_WEBHOOK }}
48+
name: gha-bot
49+
icon_url: https://avatars.slack-edge.com/2021-05-17/2068859221653_526c61e414df90dd67f7_192.png
50+
include_jobs: on-failure
51+
display_only_failed: true
52+
include_commit_message: true
53+
54+
notify_slack_failure:
55+
name: Notify failure status to Slack
56+
runs-on: ubuntu-latest
57+
if: (failure() || cancelled()) && github.ref == 'refs/heads/master' && github.event_name == 'push'
58+
needs: [secrets_scan]
59+
permissions:
60+
actions: read
61+
contents: read
62+
id-token: write
63+
steps:
64+
- name: GSM Secrets
65+
id: secrets_manager
66+
uses: toptal/actions/gsm-secrets@main
67+
with:
68+
workload_identity_provider: projects/858873486241/locations/global/workloadIdentityPools/gha-pool/providers/github-com
69+
service_account: [email protected]
70+
secrets_name: |-
71+
SLACK_MARKETING_TOOLS_2_BULLHORN_WEBHOOK:toptal-ci/SLACK_MARKETING_TOOLS_2_BULLHORN_WEBHOOK
72+
SLACK_TEST_PUB_BOT_WEBHOOK:toptal-ci/SLACK_TEST_PUB_BOT_WEBHOOK
73+
74+
- name: Parse secrets
75+
id: parse_secrets
76+
uses: toptal/actions/expose-json-outputs@main
77+
with:
78+
json: ${{ steps.secrets_manager.outputs.secrets }}
79+
80+
- uses: toptal/slack-workflow-status@master
81+
with:
82+
repo_token: ${{ secrets.GITHUB_TOKEN }}
83+
slack_webhook_url: ${{ steps.parse_secrets.outputs.SLACK_MARKETING_TOOLS_2_BULLHORN_WEBHOOK }}
84+
name: gha-bot
85+
icon_url: https://avatars.slack-edge.com/2021-05-17/2068859221653_526c61e414df90dd67f7_192.png
86+
include_jobs: on-failure
87+
display_only_failed: true
88+
include_commit_message: true
89+

.github/workflows/secrets-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
specs:
88
name: Secrets scan
9-
runs-on: ubuntu-latest
9+
runs-on: squad-growth-ubuntu2204-x64-standard
1010
permissions: write-all
1111
timeout-minutes: 10
1212
steps:

.github/workflows/unit.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,6 @@ on:
66
pull_request:
77

88
jobs:
9-
secrets_scan:
10-
name: Secrets scan
11-
runs-on: squad-growth-ubuntu2204-x64-standard
12-
permissions: write-all
13-
timeout-minutes: 10
14-
steps:
15-
- uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Get the secrets from GSM
20-
id: secrets_manager
21-
uses: toptal/actions/[email protected]
22-
with:
23-
workload_identity_provider: projects/858873486241/locations/global/workloadIdentityPools/gha-pool/providers/github-com
24-
service_account: [email protected]
25-
secrets_name: |-
26-
SLACK_BOT_TOKEN:toptal-ci/SLACK_BOT_TOKEN
27-
28-
- name: Parse secrets
29-
id: parse_secrets
30-
uses: toptal/actions/[email protected]
31-
with:
32-
json: ${{ steps.secrets_manager.outputs.secrets }}
33-
34-
- name: Secrets Scan
35-
uses: toptal/actions/secret-scanning-action@main
36-
with:
37-
github-token: ${{ secrets.GITHUB_TOKEN }}
38-
full-scan: true
39-
slack-channel: -marketing-tools-2-releases
40-
slack-token: ${{ steps.parse_secrets.outputs.SLACK_BOT_TOKEN }}
41-
429
# unit_tests:
4310
# name: Unit tests
4411
# runs-on: ubuntu-latest

0 commit comments

Comments
 (0)