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

Use github.ref_name instead of hardcoded branch name #4085

Merged
merged 3 commits into from
Sep 18, 2024

Conversation

externl
Copy link
Member

@externl externl commented Sep 18, 2024

This PR updates the coverage and doc workflows to use github.ref_name instead of a hard coded branch name for the s3 path.

This way there's nothing to update in this part of the workflows when we create a new branch of off main.

@externl externl requested a review from pepone September 18, 2024 14:10
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
if: github.event_name != 'pull_request'
Copy link
Member Author

@externl externl Sep 18, 2024

Choose a reason for hiding this comment

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

We only run the workflow on push or prs on the branch specified at the top of the file, so I think we really only need to check that it's not a PR.

Copy link
Member

Choose a reason for hiding this comment

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

What is the event_name that triggers the build when you push to an open PR?

Copy link
Member

Choose a reason for hiding this comment

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

Why no if: github.event_name == 'push' it makes clear we are only interested in push events.

Copy link
Member Author

@externl externl Sep 18, 2024

Choose a reason for hiding this comment

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

The original version I found on stack overflow. I think the original intention for using != 'pull_request' is that you could trigger the workflow manually if enabled (if configured).

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the event_name that triggers the build when you push to an open PR?

Not sure, I suspect still pull_request

@externl externl merged commit e59b65b into icerpc:main Sep 18, 2024
8 checks passed
@externl externl deleted the use-ref_name branch September 18, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants