Skip to content

Commit

Permalink
fix bash
Browse files Browse the repository at this point in the history
  • Loading branch information
osterman committed Jan 16, 2024
1 parent b09e8a4 commit 4025548
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/repo-banner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,39 @@ jobs:
- name: Determine Repo Type
id: repo
run: |
if [[ "${{ steps.metadata.outputs.repository_name }}" == "terraform-*-provider" ]]; then
name="${{ steps.metadata.outputs.repository_name }}"
type="Project"
desc="${{ steps.metadata.outputs.repository_description }}"
if [[ "${name}" == "terraform-*-provider" ]]; then
echo "Setting repo type to Terraform Provider"
echo "type=Terraform Provider" >> $GITHUB_OUTPUT
echo "name=${${{ steps.metadata.outputs.repository_name }}#terraform-}" >> $GITHUB_OUTPUT
elif [[ "${{ steps.metadata.outputs.repository_name }}" == "terraform-aws*" ]]; then
echo "name=${name#terraform-}" >> $GITHUB_OUTPUT
elif [[ "${name}" == "terraform-aws*" ]]; then
echo "Setting repo type to Terraform Module"
echo "type=Terraform Module" >> $GITHUB_OUTPUT
echo "name=${${{ steps.metadata.outputs.repository_name }}#terraform-}" >> $GITHUB_OUTPUT
elif [[ "${{ steps.metadata.outputs.repository_name }}" == "github-action-*" ]]; then
echo "name=${name#terraform-}" >> $GITHUB_OUTPUT
elif [[ "${name}" == "github-action-*" ]]; then
echo "Setting repo type to GitHub Action"
echo "type=GitHub Action" >> $GITHUB_OUTPUT
echo "name=${${{ steps.metadata.outputs.repository_name }}#github-action-}" >> $GITHUB_OUTPUT
elif [[ "${{ steps.metadata.outputs.repository_name }}" == "example-*" ]]; then
echo "name=${name#github-action-}" >> $GITHUB_OUTPUT
elif [[ "${name}" == "example-*" ]]; then
echo "Setting repo type to Example"
echo "type=Example" >> $GITHUB_OUTPUT
echo "name=${${{ steps.metadata.outputs.repository_name }}#example-}" >> $GITHUB_OUTPUT
elif [[ "${{ steps.metadata.outputs.repository_name }}" == "infra-*" ]]; then
echo "name=${name#example-}" >> $GITHUB_OUTPUT
elif [[ "${name}" == "infra-*" ]]; then
echo "Setting repo type to Infrastructure"
echo "type=Infrastructure" >> $GITHUB_OUTPUT
echo "name=${${{ steps.metadata.outputs.repository_name }}#infra-}" >> $GITHUB_OUTPUT
echo "name=${name#infra-}" >> $GITHUB_OUTPUT
else
echo "Repo type is undetermined"
echo "type=Project" >> $GITHUB_OUTPUT
echo "name=${{ steps.metadata.outputs.repository_name }}" >> $GITHUB_OUTPUT
fi
if [[ "${desc}" == "null" ]]; then
echo "desc=" >> $GITHUB_OUTPUT
else
# Only keep the first sentence
echo "desc=${desc/.*}" >> $GITHUB_OUTPUT
fi
- name: Generate banner image
Expand All @@ -58,8 +67,8 @@ jobs:
url: "file://${{github.workspace}}/banner/index.html"
output: "banner/image.png"
customizations: |
"#name": "${{ steps.repo.outputs.repository_name }}"
"#type": "${{ steps.repo.outputs.repository_name }}"
"#name": "${{ steps.repo.outputs.name }}"
"#type": "${{ steps.repo.outputs.type }}"
"#desc": "${{ steps.metadata.outputs.repository_description }}"
viewportWidth: 1280
viewportHeight: 320
Expand Down

0 comments on commit 4025548

Please sign in to comment.