-
Notifications
You must be signed in to change notification settings - Fork 436
feat(ci): dispatch GitHub analytics action #2161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
f32a3e5
c71a3ef
a89b426
b410b62
71cdbbc
af31b19
5f21dc8
aa3f4a4
ca3374d
f888e69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,40 @@ name: Reusable dispatch analytics | |
on: | ||
workflow_dispatch: | ||
|
||
schedule: | ||
- cron: '0 * * * *' | ||
|
||
permissions: | ||
id-token: write | ||
actions: read | ||
checks: read | ||
contents: read | ||
deployments: read | ||
issues: read | ||
discussions: read | ||
packages: read | ||
pages: read | ||
pull-requests: read | ||
repository-projects: read | ||
security-events: read | ||
statuses: read | ||
|
||
jobs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we run in an environment do secrets are encrypted from forks? You never know if we ever accidentally make a mistake in the IAM OIDC and allow any repo. This will prevent this attack vector. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, created a new "analytics" environment and moved the secrets there. I've removed the old secrets too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please note that the IAM OIDC would not be assumable since there's a condition to only be assumable by this repository too. In any case, it's better this way. |
||
dispatch_token: | ||
concurrency: | ||
group: analytics | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo 'hello world' | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef | ||
with: | ||
aws-region: eu-central-1 | ||
role-to-assume: ${{ secrets.AWS_ANALYTICS_ROLE_ARN }} | ||
|
||
- name: Invoke Lambda function | ||
run: | | ||
payload=$(echo -n '{"githubToken": "${{ secrets.GITHUB_TOKEN }}"}' | base64) | ||
aws lambda invoke \ | ||
--function-name ${{ secrets.AWS_ANALYTICS_DISPATCHER_ARN }} \ | ||
--payload "$payload" response.json | ||
cat response.json |
Uh oh!
There was an error while loading. Please reload this page.