Skip to content
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
24 changes: 13 additions & 11 deletions .github/workflows/shared-scheduled-context.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@ on:
type: string
required: false
default: '["ubuntu-latest"]'
secrets:
github_access_token:
description: "GitHub API token"
required: true

jobs:
update:
runs-on: ${{ fromJSON(inputs.runs-on) }}
environment: release
steps:
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: github-app
with:
app-id: ${{ vars.BOT_GITHUB_APP_ID }}
private-key: ${{ secrets.BOT_GITHUB_APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Update context.tf
shell: bash
id: update
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ steps.github-app.outputs.token }}"
run: |
if [[ -f context.tf ]]; then
echo "Discovered existing context.tf! Fetching most recent version to see if there is an update."
Expand All @@ -37,9 +40,10 @@ jobs:
echo "No changes detected! Exiting the job..."
else
echo "context.tf file has changed. Update examples and rebuild README.md."
make init
make github/init/context.tf
make readme/build
if [[ -d examples/complete ]]; then
cp -p context.tf examples/complete/context.tf ;
fi;
find . -xdev -mindepth 2 -name context.tf -exec cp -p context.tf {};
echo "create_pull_request=true" >> $GITHUB_OUTPUT
fi
else
Expand All @@ -65,6 +69,4 @@ jobs:
labels: |
auto-update
context
# Requires a GitHub PAT used to open PRs that trigger other workflows
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
token: ${{ secrets.github_access_token }}
token: ${{ steps.github-app.outputs.token }}
6 changes: 1 addition & 5 deletions .github/workflows/shared-terraform-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
type: string
required: false
default: '["ubuntu-latest"]'
secrets:
REPO_ACCESS_TOKEN:
description: "GitHub API token"
required: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -23,7 +19,7 @@ jobs:
with:
runs-on: ${{ inputs.runs-on }}
secrets:
github_access_token: ${{ secrets.REPO_ACCESS_TOKEN }}
secrets: inherit

readme:
uses: cloudposse/.github/.github/workflows/shared-atmos-readme.yml@main
Expand Down
Loading