-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update issue tagging to work without helper scripts (#172)
* Feat(ci): Update issue tagging to work without helper scripts * Refactor(ci): Change trigger to pull_request so it can be tested in PRs, we don't support forks anyway * Fix(ci): Fix quoting issue * Refactor(ci): Change to use a container with the helper scripts * Fix(ci): Change to pull_request instead of _target, we don't support forks * Fix(ci): Avoid issues with cloned git repos * Fix(ci): Templating issue with repository name * Fix(ci): Change conditional to use new name * Fix(ci): Add repository config options to a few other lines * Cleanup(ci): Remove helper scripts, as they are now in a container * Fix(ci): Remove temporary test file * Feat(ci): Add container definition, and workflow to build it * Fix(ci): Swap to open image * Fix(ci): Convert to docker due to lack of support * Fix(ci): Forgot to specify containerfile in build * Fix(ci): Fix script name * Doc(ci): Document usage of scripts in container
- Loading branch information
Showing
7 changed files
with
84 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
containerize: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Login to Quay | ||
if: github.event.name == 'push' | ||
run: docker login quay.io -u ${{ secrets.QUAY_UNAME }} -p ${{ secrets.QUAY_PASSWD }} | ||
|
||
- name: Build container | ||
run: docker build -t quay.io/zathras/jira-issue-tagging-ci:latest -f Containerfile . | ||
working-directory: ci/issue-tagging-container | ||
|
||
- name: Push container | ||
if: github.event_name == 'push' | ||
run: docker push quay.io/zathras/jira-issue-tagging-ci:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM registry.access.redhat.com/ubi9-minimal:9.5 AS builder | ||
|
||
RUN microdnf -y install wget | ||
RUN wget https://cli.github.com/packages/rpm/gh-cli.repo -O /gh-cli.repo | ||
|
||
FROM registry.access.redhat.com/ubi9-minimal:9.5 | ||
|
||
COPY --from=builder /gh-cli.repo /etc/yum.repos.d/gh-cli.repo | ||
RUN microdnf -y install gh python3 jq | ||
WORKDIR /opt/tools | ||
|
||
COPY . /opt/tools/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
mentioned_issues=$(gh -R "$1" pr view "$2" --json body | jq -r .body | grep -Eo '#[0-9]+' | sed -e 's/#//g') | ||
|
||
for issue in $mentioned_issues; do | ||
if gh -R "$1" issue view "$issue" --json id > /dev/null; then | ||
echo -n "$issue " | ||
fi | ||
done |