github-activity-readme
github-activity-readme copied to clipboard
my workflow for recent activity is not working.
this is my yml file
also having this error
got this error this morning
Same Here
Any update on this?
Any update on this?
I had faced the same problem. But I solved the problem eventually. Here are my codes.
YML file
name: Update README
on:
schedule:
- cron: '*/30 * * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: Update this repo's README with recent activity
steps:
- uses: actions/checkout@v2
- uses: jamesgeorge007/github-activity-readme@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
README.md
Copy all the codes. If you only copy and paste the <start section>
and <end section>
in README file. It will not be work.
# :zap: Recent Activity
<!--START_SECTION:activity-->
1. π Merged PR [#90](https://github.com/CartimDraluc/Cartimpedia/pull/90) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
2. πͺ Opened PR [#90](https://github.com/CartimDraluc/Cartimpedia/pull/90) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
3. π£ Commented on [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
4. βοΈ Closed issue [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
5. βοΈ Opened issue [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
<!--END_SECTION:activity-->
Here is my repo : https://github.com/NyanKaungSet/Github-Workflow/blob/master/README.md#Recent_Actvity
If the workflow failed, make sure you created GITHUB_TOKEN
with following scopes in your Personal access tokens.
- admin:public_key
- gist
- notifications
- workflow
- write:packages
I hoped this may be helpful.
I had faced the same problem. But I solved the problem eventually. Here are my codes.
YML file
name: Update README on: schedule: - cron: '*/30 * * * *' workflow_dispatch: jobs: build: runs-on: ubuntu-latest name: Update this repo's README with recent activity steps: - uses: actions/checkout@v2 - uses: jamesgeorge007/github-activity-readme@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
README.md
Copy all the codes. If you only copy and paste the
<start section>
and<end section>
in README file. It will not be work.# :zap: Recent Activity <!--START_SECTION:activity--> 1. π Merged PR [#90](https://github.com/CartimDraluc/Cartimpedia/pull/90) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia) 2. πͺ Opened PR [#90](https://github.com/CartimDraluc/Cartimpedia/pull/90) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia) 3. π£ Commented on [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia) 4. βοΈ Closed issue [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia) 5. βοΈ Opened issue [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia) <!--END_SECTION:activity-->
Here is my repo : https://github.com/NyanKaungSet/Github-Workflow/blob/master/README.md#Recent_Actvity
If the workflow failed, make sure you created
GITHUB_TOKEN
with following scopes in your Personal access tokens.
- admin:public_key
- gist
- notifications
- workflow
- write:packages
I hoped this may be helpful.
I can confirm that it is still not working.
Here is the last output using the same configuration you mentioned:
Run jamesgeorge007/github-activity-readme@master
⬀ debug Getting activity for fbuireu
⬀ debug Activity for fbuireu, [10](https://github.com/fbuireu/fbuireu/runs/7861274323?check_suite_focus=true#step:3:11)0 events found.
β success Wrote to README
⬀ debug Something went wrong
β fatal Error: Invalid status code: 1
at ChildProcess.<anonymous> (/home/runner/work/_actions/jamesgeorge007/github-activity-readme/master/dist/index.js:1530:15)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1022:16)
at Socket.<anonymous> (internal/child_process.js:444:[11](https://github.com/fbuireu/fbuireu/runs/7861274323?check_suite_focus=true#step:3:12))
at Socket.emit (events.js:314:20)
at Pipe.<anonymous> (net.js:675:[12](https://github.com/fbuireu/fbuireu/runs/7861274323?check_suite_focus=true#step:3:13))
My GITHUB_TOKEN
has the exact permissions you mentioned and following the stack trace of the error, where success appears (β success
) it doesn't look like permission issues.
Moreover, my README.md
file has the comments needed by the action:
### Latest Activity
<!--START_SECTION:activity-->
<!--END_SECTION:activity-->
I can confirm that it is still not working.
As I mentioned above, Your README file only have these lines.
<!--START_SECTION:activity-->
<!--END_SECTION:activity-->
Delete those 2 lines and add the following codes. Save it and run the workflow. If this still doesnβt work, I will fork your repo and try from my side.
<!--START_SECTION:activity-->
1. π Merged PR [#90](https://github.com/CartimDraluc/Cartimpedia/pull/90) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
2. πͺ Opened PR [#90](https://github.com/CartimDraluc/Cartimpedia/pull/90) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
3. π£ Commented on [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
4. βοΈ Closed issue [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
5. βοΈ Opened issue [#89](https://github.com/CartimDraluc/Cartimpedia/issues/89) in [CartimDraluc/Cartimpedia](https://github.com/CartimDraluc/Cartimpedia)
<!--END_SECTION:activity-->
Sorry, but it doesn't make sense at all what you are suggesting. Everything wrapped by <!--START_SECTION:activity-->
is replaced by the action's code (what extracts from GitHub's activity). If that was the problem, it would never work because it would be never able to replace the content inside the <!--START_SECTION:activity-->
section.
I've also tried just to be sure, and it doesn't work, indeed.
I have my own version of the action (see https://github.com/jamesgeorge007/github-activity-readme/pull/79) where we add a TARGET_FILE
option, but I've also tried using the base configuration (the default one) and the one you suggested, and it still doesn't work. Feel free to fork if you want.
For those who are facing this issue:
Run jamesgeorge007/github-activity-readme@master
⬀ debug Getting activity for fbuireu
⬀ debug Activity for fbuireu, [10](https://github.com/fbuireu/fbuireu/runs/7861274323?check_suite_focus=true#step:3:11)0 events found.
β success Wrote to README
⬀ debug Something went wrong
β fatal Error: Invalid status code: 1
at ChildProcess.<anonymous> (/home/runner/work/_actions/jamesgeorge007/github-activity-readme/master/dist/index.js:1530:15)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1022:16)
at Socket.<anonymous> (internal/child_process.js:444:[11](https://github.com/fbuireu/fbuireu/runs/7861274323?check_suite_focus=true#step:3:12))
at Socket.emit (events.js:314:20)
at Pipe.<anonymous> (net.js:675:[12](https://github.com/fbuireu/fbuireu/runs/7861274323?check_suite_focus=true#step:3:13))
After a long debugging, it seems that the issue is related to the permissions or security of the repo/branch. The CI GitHub action works as intended (see β success
message) however, it seems that after that, is not able to push or to apply the changes to the given file and because of the lack of debug errors it's easy to lose the trace of the issue.
Make sure that you are not locking or protecting the main
/master
branch whatsoever. Personally, I think that it should be added as a feature to bypass or to have a security feature to write in the protected branches (that's why the token is) but in the meantime, this is a workaround.
After I removed the protections, the action worked as intended.
Just add the following permission flag to allow github actions to update the contents of your repository:
name: GitHub Activity
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: jamesgeorge007/github-activity-readme@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This way a token with write/commit privileges will be created. I have changed the README.md to reflect this necessary change.