fix: use wildcard for allowed_bots in claude-code-action #84
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: pull_request | |
| on: | |
| pull_request: | |
| branches: | |
| - dev | |
| - master | |
| jobs: | |
| unit_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: vars | |
| run: | | |
| if [[ "$REF" =~ ^[0-9]+.[0-9]+.[0-9]+$ || "$REF" == "master" ]]; then | |
| BRANCH=master | |
| INFRA_BRANCH=master | |
| GCP_ENV=production | |
| GCP_PROJECT_ID=${{ secrets.PROD_CP_GCP_PROJECT_ID }} | |
| elif [[ "$REF" =~ ^[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+$ || "$REF" != "master" ]]; then | |
| BRANCH=dev | |
| INFRA_BRANCH=develop | |
| GCP_ENV=develop | |
| GCP_PROJECT_ID=${{ secrets.DEV_CP_GCP_PROJECT_ID }} | |
| else | |
| echo "Invalid tag format: $REF" | |
| exit 1 | |
| fi | |
| cat <<- EOF >> ${GITHUB_ENV} | |
| BRANCH=${BRANCH} | |
| GCP_ENV=${GCP_ENV} | |
| GCP_PROJECT_ID=${GCP_PROJECT_ID} | |
| IMAGE_NAME=gcr.io/${GCP_PROJECT_ID}/${GITHUB_REPOSITORY##*/} | |
| IMAGE_TAG_SHA=${GITHUB_SHA:0:7} | |
| EOF | |
| - name: build_image_test | |
| run: | | |
| docker build -f Dockerfile.test -t ${IMAGE_NAME}:${IMAGE_TAG_SHA}-pr `pwd` | |
| - name: unit_test | |
| run: | | |
| docker run --rm --entrypoint=npm ${IMAGE_NAME}:${IMAGE_TAG_SHA}-pr test | |
| notify: | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - unit_test | |
| steps: | |
| - uses: technote-space/workflow-conclusion-action@v3.0.3 | |
| if: ${{ ! env.ACT }} | |
| - name: vars | |
| id: vars | |
| run: | | |
| STATUS=${WORKFLOW_CONCLUSION:-failure} # neutral, success, skipped, cancelled, timed_out, action_required, failure | |
| if [[ ${STATUS} == "success" ]]; then | |
| ICON_EMOJI=":white_check_mark:" | |
| elif [[ ${STATUS} == "failure" ]]; then | |
| ICON_EMOJI=":sos:" | |
| else | |
| ICON_EMOJI=":eyes:" | |
| fi | |
| MESSAGE=" ${ICON_EMOJI} \`dev\` \`${STATUS}\` @${{ github.actor }} | |
| this is message" | |
| FOOTER="this is footer" | |
| if [[ "${{ ! env.ACT }}" == "true" ]]; then | |
| STATUS=${{ env.WORKFLOW_CONCLUSION }} | |
| if [[ "push" == "${{ github.event_name }}" ]]; then | |
| MESSAGE=" ${ICON_EMOJI} \`${{ github.ref_name }}\` \`${STATUS}\` | |
| ${{ github.event.head_commit.message }}" | |
| FOOTER="*${{ github.ref_name }}* of _${{ github.repository }}_" | |
| elif [[ "pull_request" == "${{ github.event_name }}" ]]; then | |
| MESSAGE=" ${ICON_EMOJI} \`${{ github.base_ref }}\` \`${STATUS}\` | |
| ${{ github.event.pull_request.title }}" | |
| FOOTER="*${{ github.head_ref }}* of _${{ github.repository }}_" | |
| fi | |
| fi | |
| echo "message=${MESSAGE//$'\n'/'%0A'}" >> $GITHUB_OUTPUT | |
| echo "footer=${FOOTER}" >> $GITHUB_OUTPUT | |
| echo "status=${STATUS}" >> $GITHUB_OUTPUT | |
| - name: slack_notification | |
| uses: rtCamp/action-slack-notify@v2.3.0 | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.CP_SLACK_CHANNEL_RG_CRYPTO }} | |
| SLACK_USERNAME: Github Action | |
| SLACK_ICON_EMOJI: ":robot_face:" | |
| SLACK_COLOR: ${{ steps.vars.outputs.status }} | |
| SLACK_MESSAGE: ${{ steps.vars.outputs.message }} | |
| SLACK_FOOTER: ${{ steps.vars.outputs.footer }} | |
| SLACK_LINK_NAMES: true |