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

gha: update to use oidc #131

Merged
merged 3 commits into from
Sep 26, 2024
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
16 changes: 5 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
---
name: Build and Commit Documentation

on:
pull_request:
types: [ labeled ]

types: [labeled]
jobs:
build_and_commit:
if: contains(github.event.pull_request.labels.*.name, 'docs')
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Run make command
run: make doc

- run: make doc
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" || echo "No changes to commit"
git push origin HEAD:${{ github.head_ref }}
git push origin HEAD:${{ github.head_ref }}
25 changes: 9 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
# Terraform Provider release workflow.
---
name: Release
on:
push:
tags:
- 'v*'

tags: ['v*']
permissions:
contents: write

id-token: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_SM_READONLY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SM_READONLY_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: get secrets from aws sm
uses: aws-actions/aws-secretsmanager-get-secrets@v2
aws-region: ${{ vars.RP_AWS_CRED_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.RP_AWS_CRED_ACCOUNT_ID }}:role/${{ vars.RP_AWS_CRED_BASE_ROLE_NAME }}${{ github.event.repository.name }}
- uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
,sdlc/prod/github/tf_provider_rp
Expand All @@ -32,14 +27,12 @@ jobs:
with:
go-version-file: 'go.mod'
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
- uses: crazy-max/ghaction-import-gpg@v6
id: import_gpg
with:
gpg_private_key: ${{ env.TF_PROVIDER_RP_GPG_PRIVATE_KEY }}
passphrase: ${{ env.TF_PROVIDER_RP_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
- uses: goreleaser/goreleaser-action@v6
with:
args: release --clean
env:
Expand Down