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

chore: add gh action to update app templates hash #3838

Merged
merged 8 commits into from
Apr 26, 2022

Conversation

mndeveci
Copy link
Contributor

@mndeveci mndeveci commented Apr 26, 2022

Which issue(s) does this change fix?

N/A

Why is this change necessary?

We recently added a configuration file which keeps the latest commit hash from aws/aws-sam-cli-app-templates repositorty. This GH action is updating that hash value in configuration by running it every hour (or manually).

Test run in fork: https://github.com/mndeveci/aws-sam-cli/actions/runs/2223773270
Result PR in fork: mndeveci#3

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mndeveci mndeveci changed the title feat: add gh action to update app templates hash chore: add gh action to update app templates hash Apr 26, 2022
Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

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

Requesting changes just to understand the answer of my following question:

How does this handle if the hash is not changing? It seems like this will still create a PR but not sure what the create pr job actually handles this or not.


on:
schedule:
- cron: "0 * * * *"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment on what this cron is? I hate trying to read cron.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, this is for every hour, let me add that as a comment

@mndeveci
Copy link
Contributor Author

How does this handle if the hash is not changing? It seems like this will still create a PR but not sure what the create pr job actually handles this or not.

I verified this behavior in the test repositories. If there is no change and workflow is going to exit without creating a PR (https://github.com/mndeveci/mock-cli/runs/6180064552?check_suite_focus=true).

Branch 'update_app_templates_hash' no longer differs from base branch 'develop'
Deleting branch 'update_app_templates_hash'

And if next time this workflow runs with a change, it will create a PR (https://github.com/mndeveci/mock-cli/runs/6180080878?check_suite_focus=true).

@mndeveci mndeveci requested review from jfuss and hoffa April 26, 2022 20:41
@mndeveci
Copy link
Contributor Author

Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

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

LGTM

@mndeveci mndeveci merged commit 2544f84 into aws:develop Apr 26, 2022
@mndeveci mndeveci deleted the gh_action_to_update_app_templates_hash branch April 26, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants