-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
add: github action corn sync data #5
Conversation
Thanks for working on this! However, I don't think committing the entire data.json is a good approach, think about just committing the head sha of the source repo would be enough (netlify will handle the fetch and build process) |
.github/workflows/run_cafe_sync.yml
Outdated
- name: Push new Cafe | ||
uses: github-actions-x/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "Add new Cafe" | ||
files: src/data.json | ||
rebase: 'true' | ||
name: yihong0618 | ||
email: [email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Push new Cafe | |
uses: github-actions-x/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Add new Cafe" | |
files: src/data.json | |
rebase: 'true' | |
name: yihong0618 | |
email: [email protected] | |
- uses: EndBug/add-and-commit@v4 | |
with: | |
message: 'chore: update source' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
And I would suggest using this action instead :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I think you are right, thanks. That will be easily. So can I create one json file
only store the commit-sha on source repo if it change we trigger the action commit and netlify will do the other job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly! I think a plain text file with the sha will do. You can run this line to get the latest sha
curl https://api.github.com/repos/ElaWorkshop/awesome-cn-cafe/branches/master --silent | grep "sha" | head -n1 > sha
Looking great to me! Thanks for your work, merging now :) |
Thank you, really learned a lot from your kind advice and repo. |
Please change the secret token username and email in GitHub action.