Skip to content
name: " Terraform modules release on OCI"
permissions:
contents: write # needed to write releases
id-token: write # needed for keyless signing
packages: write # needed for ghcr access
on:
workflow_call:
inputs:
runs-on:
required: false
type: string
default: ubuntu-latest
organization_layer_name:
required: false
type: string
default: platform
team_name:
required: true
type: string
products_path:
required: false
type: string
default: "products"
env:
REPOSITORY: "${{ github.event.repository.name }}"
jobs:
build-push:
runs-on: "${{ inputs.runs-on }}"
steps:
- uses: actions/checkout@v2
- uses: sigstore/cosign-installer@main
- uses: fluxcd/flux2/action@main
- name: Prepare tag
id: prepare_tag
run: |
VERSION="${{ github.event.inputs.tag }}-${GITHUB_SHA::8}"
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF/refs\/tags\//}
fi
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=VERSION::${VERSION}
- name: Docker login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

Check failure on line 52 in .github/workflows/terraform-modules-oci-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/terraform-modules-oci-release.yml

Invalid workflow file

You have an error in your yaml syntax on line 52
- name: Publish OCI
run: |
echo "${{ steps.prepare_tag.outputs.VERSION }}"
basePath="${{ inputs.organization_layer_name }}/${{ inputs.team_name }}/${{ inputs.products_path }}"
for terraformPath in $(find "$basePath" -type d -name 'terraform' -exec dirname {} \; | sed "s|^$basePath/||" | sort | uniq); do
productName=$(echo "$terraformPath" | sed 's/\//-/g')
echo "Publishing $productName"
echo "${{ steps.prepare_tag.outputs.VERSION }} ${basePath}/${terraformPath}/terraform ${{ inputs.organization_layer_name }}-${{ inputs.team_name }}-${productName}"
# bash -x ./publish-oci.sh ${{ steps.prepare_tag.outputs.VERSION }} "${basePath}/${terraformPath}/terraform" "${{ inputs.organization_layer_name }}-${{ inputs.team_name }}-${productName}"
done