Skip to content

fix: Fix for GHES to allow variations in GitHub Actions bot user id #742

fix: Fix for GHES to allow variations in GitHub Actions bot user id

fix: Fix for GHES to allow variations in GitHub Actions bot user id #742

Workflow file for this run

name: Continuous Integration
on:
pull_request:
# Note: We only test our internal action locally in the pull request branch to avoid
# actually creating releases for terraform modules in this primary github action
# repository. Thus, we ensure that the "closed" option is not present. Separately,
# we test the action as designed in a separate terraform-module repository.
types: [opened, reopened, synchronize]
branches:
- main
permissions:
contents: write # Required to create tags, creaste releases and update wiki
pull-requests: write # Required to comment on pull requests
jobs:
test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Install Dependencies
id: npm-ci
run: npm ci --no-fund
- name: Package
id: npm-package
run: npm run package
- name: Test Local Action
id: test-action
uses: ./
with:
major-keywords: major change,breaking change
minor-keywords: feat,feature
patch-keywords: fix,chore,docs
default-first-tag: v1.0.0
disable-wiki: false
wiki-sidebar-changelog-max: 10
delete-legacy-tags: false # Note: We don't want to delete tags in this repository
terraform-docs-version: v0.19.0
module-path-ignore: tf-modules/kms/examples/complete
module-change-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**,examples/**
module-asset-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**
use-ssh-source-format: true
- name: Test Action Outputs
id: test-outputs
run: |
echo "Testing action outputs..."
# Test if outputs are set
if [[ -n "${{ steps.test-action.outputs.changed-module-names }}" ]]; then
echo "✅ Output 'changed-modules-names': ${{ steps.test-action.outputs.changed-module-names }}"
else
echo "❌ No changed module names found"
fi
if [[ -n "${{ steps.test-action.outputs.changed-module-paths }}" ]]; then
echo "✅ Output 'changed-module-paths': ${{ steps.test-action.outputs.changed-module-paths }}"
else
echo "❌ No changed module paths found"
fi
if [[ -n "${{ steps.test-action.outputs.changed-modules-map }}" ]]; then
echo "✅ Output 'changed-modules-map':"
echo '${{ steps.test-action.outputs.changed-modules-map }}' | jq -r '
"Found \(length) changed module(s):",
(to_entries[] |
"• \(.key):",
" - Path: \(.value.path)",
" - Latest Tag: \(.value.latestTag)",
" - Next Tag: \(.value.nextTag)",
" - Release Type: \(.value.releaseType)"
)
'
else
echo "❌ No changed modules map found"
fi
# Silently validate JSON structure is an object
echo '${{ steps.test-action.outputs.changed-modules-map }}' | jq -e 'type == "object"' > /dev/null || {
echo "❌ Expected object type in changed-modules-map"
exit 1
}
# Test new outputs for all modules
if [[ -n "${{ steps.test-action.outputs.all-module-names }}" ]]; then
echo "✅ Output 'all-module-names': ${{ steps.test-action.outputs.all-module-names }}"
else
echo "❌ No all module names found"
fi
if [[ -n "${{ steps.test-action.outputs.all-module-paths }}" ]]; then
echo "✅ Output 'all-module-paths': ${{ steps.test-action.outputs.all-module-paths }}"
else
echo "❌ No all module paths found"
fi
if [[ -n "${{ steps.test-action.outputs.all-modules-map }}" ]]; then
echo "✅ Output 'all-modules-map':"
echo '${{ steps.test-action.outputs.all-modules-map }}' | jq -r '
"Found \(length) total module(s):",
(to_entries[] |
"• \(.key):",
" - Path: \(.value.path)",
" - Latest Tag: \(.value.latestTag)",
" - Latest Tag Version: \(.value.latestTagVersion)"
)
'
else
echo "❌ No all modules map found"
fi
# Silently validate JSON structure is an objects
echo '${{ steps.test-action.outputs.all-modules-map }}' | jq -e 'type == "object"' > /dev/null || {
echo "❌ Expected object type in all-modules-map"
exit 1
}