Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gha(update-docs-webhook): fix workflow syntax #50778

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .github/workflows/update-docs-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: Call deployment webhook
env:
WEBHOOK_URL: ${{ secrets[AMPLIFY_DOCS_DEPLOY_HOOK] }}
WEBHOOK_URL: ${{ secrets["AMPLIFY_DOCS_DEPLOY_HOOK"] }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Why use this syntax instead of the secrets.AMPLIFY_DOCS_DEPLOY_HOOK used everywhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was done this way to support matrix, when we had to call two webhooks:

  • matrix:
    webhooks:
    - url_secret_name: DOCS_DEPLOY_HOOK
    http_method: GET
    - url_secret_name: AMPLIFY_DOCS_DEPLOY_HOOK
    http_method: POST
    steps:
    - name: Call deployment webhook
    env:
    WEBHOOK_URL: ${{ secrets[matrix.webhooks.url_secret_name] }}
    run: |
    if curl -X ${{ matrix.webhooks.http_method }} --silent --fail --show-error "$WEBHOOK_URL" > /dev/null; then
    echo "Triggered successfully"
    fi

Now when second webhook and matrix is removed, there is no real reason to keep it this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in a9b7765

run: |
if curl -X POST --silent --fail --show-error "$WEBHOOK_URL" > /dev/null; then
echo "Triggered successfully"
Expand Down
Loading