-
Notifications
You must be signed in to change notification settings - Fork 1
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
New (reusable) workflow to add repository items to GitHub Projects #55
Conversation
I purposefully didn't include the workflow's Would suggest to remove them all (and get rid of the superfluous newlines in the list), but that's a change that should go in a separate PR. |
Things I'm not entirely sure about:
|
docs/add-to-project.md
Outdated
add-to-project: | ||
uses: acdh-oeaw/prosnet-workflows/.github/workflows/add-to-project.yml@RELEASE_VERSION | ||
secrets: | ||
ADD_TO_PROJECT_TOKEN: ${{ secrets.GH_PROJECTS_TOKEN }} |
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 would change GH_PROJECT_TOKEN
to ADD_TO_PROJECT_TOKEN
, as this is the variable name we use
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.
My reasoning behind using different names was (generally would be) to try to make variable names make a bit more sense within their respective contexts.
So for someone looking at the workflow files, ADD_TO_PROJECT_TOKEN
should be recognisable as a reference to a token specific to this workflow. For someone looking at the repo's action variables and secrets, who's not been following any workflow-related developments, the name would be meaningless. They wouldn't necessarily be able to guess what exactly GH_PROJECT_*
is used for either, but it could at least be a clue (hence also shared prefix for token secret + project num var).
I think it was actually the variable name in the original workflow which made me feel action secrets/vars should be a bit more helpful :P (I didn't know and couldn't guess what PAT stood for, ended up googling for it).
But I can change the name so they read the same.
tested and works! |
Yay!! Very cool! But oh nooooo, for some reason, I thought this issue only applied to classic tokens. But your tests indeed show me as the user who "added" tickets. Meh. |
e63bd7e
to
ac2e217
Compare
Renamed the variable and included minor style + structural changes (e.g. |
Btw. I think this:
can only be solved by using a GitHub App (which needs to be created on the org level) instead of personal tokens. |
This follows up on previous, abandoned attempts to create a workflow which allows adding of issues (and/or PRs) to GitHub Projects.
The built-in auto-add workflow by GitHub continues to only cover 1 repo for free accounts, but e.g. the APIS-RDF project is now connected to 4 or 5 repos, and it's easy to forget to manually add issues which are not covered by the built-in workflow (which means there are always issues which stay "lost" in their repos).
GitHub tokens were another blocker, I guess (?! classic PATs are extremely permissive, so I assume we wouldn't have wanted to use those) but Projects v2 have been working with fine-grained tokens for a while now.
I made this workflow reusable so other ACDH-CH projects could make use of it too if they wanted to (AFAIK there are several other GitHub projecs active within our org).