-
Notifications
You must be signed in to change notification settings - Fork 0
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 job to update open-api-framework #4
Conversation
40139a4
to
d8c6fee
Compare
I just realised I misspelled my branch :( |
4a6fa8b
to
7514ef2
Compare
This feels very hacky and is implemented though trial and error. Action steps do not support conditionals really and this code requires a lot of conditionals. I probably should have create a python script but I had already spend a lot of time on this :/ |
7514ef2
to
8668d06
Compare
.github/workflows/oaf-check.yml
Outdated
if [[ $(gh pr list --json title | grep '\"title\"') ]]; then | ||
echo "EXISTS=true" >> $GITHUB_ENV | ||
else | ||
echo "EXISTS=false" >> $GITHUB_ENV |
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.
Maybe other conditionals should be written like this?
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.
I probably should have create a python script but I had already spend a lot of time on this :/
would it be a lot of work to rewrite this as a python or bash script?
@stevenbal it should be quite quick to rewrite fully in bash since it is basically already in bash and does not install anything other than python. Maybe python as well? Not sure but it would give me greater control. I was going to do it later in my own time cause it is annoying me. Also note for myself: git diff works between branches |
@Coperh If it's possible to make it a python script that would probably be my preference, it seems easier than working with conditionals in GH actions |
045836f
to
678abb4
Compare
5f70adf
to
129f185
Compare
After trying to implement Steven's suggestion. I released that it did not work. Apparently git diff returning an output counts as true even with exit code 1. Also I do not think git commit worked either. Refactored it and it should be much cleaner now. Will tag the last commit and pin the action to that tag when approved. |
Same PR is used. The ones by me are testing locally. |
.github/workflows/oaf-check.yml
Outdated
run: echo "OAF_VERSION=$(grep -Po '(?<=open-api-framework==)[^\n]*' requirements/dev.txt)" >> $GITHUB_ENV | ||
- name: Create Update PR | ||
if: failure() | ||
uses: maykinmedia/open-api-workflows/actions/create-update-pr@feature/udate-oaf-pr |
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.
Probably good to do this as the last bit of work. You could also tag a beta/alpha version to check if things work.
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.
How is this file being called? Is it defined in the down stream project?
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.
It's called in check .github/workflows/oaf-check.yml
in this PR which is then called for exam le here: https://github.com/Coperh/objects-api/blob/master/.github/workflows/oaf-check.yml
fd25ccb
to
32df52e
Compare
32df52e
to
223f118
Compare
7c429c2
to
38e3aa3
Compare
Changed to use the full command option names. Will tag after approval |
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.
Looks good!
partially fixes: maykinmedia/open-api-framework#44
Old PR Example