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) |
| - 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.
| - 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.
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.
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.