Skip to content
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

Reduce permissions and fix version in AWS Actions #45

Merged
merged 7 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/aws-runner-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on: workflow_dispatch # Manual trigger for testing
# Add permissions needed for OIDC authentication
permissions:
id-token: write # Required for requesting the JWT
contents: read # Required for actions/checkout
actions: write # Required for registering runners

jobs:
start-runner:
Expand All @@ -24,12 +22,13 @@ jobs:

- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
uses: machulav/ec2-github-runner@v2.3.8
with:
mode: start
github-token: ${{ secrets.REPO_ADMIN_TOKEN }}
ec2-image-id: ami-006ec002b74f6c066 # Amazon Linux 2 in us-east-2
ec2-instance-type: t3.micro
market-type: spot
subnet-id: ${{ secrets.AWS_SUBNET_ID }}
security-group-id: ${{ secrets.AWS_SECURITY_GROUP_ID }}
pre-runner-script: |
Expand Down Expand Up @@ -72,7 +71,7 @@ jobs:
role-session-name: github-runner-session

- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
uses: machulav/ec2-github-runner@v2.3.8
with:
mode: stop
github-token: ${{ secrets.REPO_ADMIN_TOKEN }}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/cpi-count-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on: workflow_dispatch

permissions:
id-token: write
contents: read
actions: write

jobs:
start-runner:
Expand All @@ -23,7 +21,7 @@ jobs:

- name: Start EC2 runner
id: start-ec2-runner
uses: tverghis/ec2-github-runner@7170053c36b2928213de1cf2303ac85059dadeee
uses: machulav/ec2-github-runner@v2.3.8
with:
mode: start
github-token: ${{ secrets.REPO_ADMIN_TOKEN }}
Expand Down Expand Up @@ -127,7 +125,7 @@ jobs:
role-session-name: github-runner-session

- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
uses: machulav/ec2-github-runner@v2.3.8
with:
mode: stop
github-token: ${{ secrets.REPO_ADMIN_TOKEN }}
Expand Down
Loading