[Bug] Step 0 does not complete when creating a repository of the course from template
shoraine opened this issue ยท 9 comments
Describe the bug
Step 0 of the workflow which moves the course along does not complete. Due to insufficient permissions for GitHub Actions the initial commit gets stuck. This breaks the workflow and prevents the course from moving beyond step 0. Completion with pull request/merge is not possible.
To Reproduce
Steps to reproduce the behavior:
- Go to https://skills.github.com/
- Click on GitHub Pages (https://github.com/skills/github-pages)
- Click on 'Use this template'
- Right-click 'Create a new repository' and 'Open link in new tab'
- Repository name: 'github-pages', everything else left alone
- Click 'Create repository from template'
- Switch to 'my-pages' branch
- Notice README.md does not advance to Step 1
- Go to Actions tab
- Click on 'Step 0, Start' in the 'Actions' section
- Click on 'Initial commit' (red x) in the workflow view
- Click on 'On start' (red x) under '0-start.yml'
- Find error under 'Create my-pages branch, initial Pages files, and pull request'
Expected behavior
Pull request is created and step 0 completes, advancing the course to step 1.
Device information
- Type: PC
- OS: Windows 10
- Browser: Edge
- Version: 109.0.1518.55 (Official build) (64-bit)
Additional context
This appears to be a problem in other courses as well. See skills/communicate-using-markdown#29.
Steps to fix (as an user)
1 - Go to settings and check the option to allow Actions create and accept pull-requests.
2 - Go go settings and allow the pages to the main branch (as the 'github-pages repo' step-1 says).
3 - Delete the my-pages branche if it was created.
4 - Clone the repo in your local machine.
5 - Update all the 'uses: actions/checkout@v2' in all the 5 files steps on the '.github/workflow/' to the current version of the checkout on marketplace:
- name: Checkout
uses: actions/checkout@v3.3.0
6 - push all the code and keep your skills lab.
Investigating bugs root
The thing that I notice after rerunning the (failed) job with debugger option was this error (Attempt#2):
(as something in the proccess create a branch and edit the main branch after and tried to push without pull before)
I decide to delete 'my-pages' branch thinking that if this above happens, maybe branching from the main, it shows me a new error right after create it (Attempt#4):
_(the Github Actions wasn't allowed (by deafult) to create and approve pull requests. Github Documentation about it.
So I enable it and rerun (Attempt#5), and again, I had to delete the 'my-pages' branch because it shows the same at (Attempt#2). At the Attempt#6 a new journey of the erros similar to Attempt#2 started, so I adopt a new strategy.
After the attempt#6 give me some tips and after some searchs in google, I decided to change the checkout version in the workflow, all checkouts steps to v3.3.0 version, and it works very well after rerun the steps and follow the README steps.
The workflow 0-start.yml
in the course skills/release-based-workflow also creates a pull request but it runs without errors. The restriction can probably be circumvented by running shell scripts (.github/script/*.sh
) instead of running commands directly coded in YAML files (.github/workflows/*.yml
).
The workflow
0-start.yml
in the course skills/release-based-workflow also creates a pull request but it runs without errors. The restriction can probably be circumvented by running shell scripts (.github/script/*.sh
) instead of running commands directly coded in YAML files (.github/workflows/*.yml
).
@heiskr I would like to hear from you about this. I'm planning to open a PR to change the UNIX commands coded in YAML files into shell scripts.
Oh, I didn't realize someone had added the closes tag to the pull request ๐ฌ
We received guidance to remove all usage of gh pr create and gh pr review from the courses, so you'll probably be seeing pull requests from various folks at GitHub over the next week or two.
Noted. Then I will wait the updates.
@heiskr I wonder how you will change the review-pull-requests course, removing all usage of gh pr create
.
The workflow
0-start.yml
in the course skills/release-based-workflow also creates a pull request but it runs without errors. The restriction can probably be circumvented by running shell scripts (.github/script/*.sh
) instead of running commands directly coded in YAML files (.github/workflows/*.yml
).
Oh, the restriction cannot be circumvented by running shell scripts.
We've updated this course to include
- (optional) Create a pull request to view all the changes you'll make throughout this course. Click the Pull Requests tab, click New pull request, set
base: main
andcompare:my-pages
.
and we've removed the usage of gh pr create
. We are still working on the other courses, currently I believe we have 6 of 14 updated so far.
Thank you for bringing this issue to our attention.