-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
16 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 |
---|---|---|
|
@@ -12,17 +12,26 @@ concurrency: | |
group: clean-up-images-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
find_unused_images: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Retrieve Credentials | ||
id: import-secrets | ||
uses: hashicorp/[email protected] | ||
with: | ||
url: https://vault.prism.spectrocloud.com | ||
method: approle | ||
roleId: ${{ secrets.VAULT_ROLE_ID }} | ||
secretId: ${{ secrets.VAULT_SECRET_ID }} | ||
secrets: /providers/github/organizations/spectrocloud/token?org_name=spectrocloud token | VAULT_GITHUB_TOKEN | ||
|
||
- id: checkout | ||
name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }} | ||
|
||
- name: Setup Nodejs | ||
uses: actions/setup-node@v4 | ||
|
@@ -34,8 +43,11 @@ jobs: | |
- name: Find unused images | ||
run: make find-unused-images | ||
|
||
- name: Install GitHub CLI | ||
run: sudo apt-get install gh | ||
- name: Set Git User | ||
# see: https://github.com/actions/checkout/issues/13#issuecomment-724415212 | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
- name: Create PR with unused images | ||
run: | | ||
|
@@ -60,16 +72,14 @@ jobs: | |
git push origin $branch_name | ||
# Create the pull request | ||
gh pr create --base master --title "docs: clean up librarium unused images " --body "$(cat <<EOF | ||
## Describe the Change | ||
This PR removes images identified as unused across all our branches. | ||
The images are identified using `scripts/find-unused-images.sh` script. | ||
Please review this PR carefully before merging it. | ||
EOF | ||
)" | ||
echo -e ' | ||
## Describe the Change \n | ||
This PR removes images identified as unused across all our branches.\n | ||
The images are identified using `scripts/find-unused-images.sh` script.\n | ||
Please review this PR carefully before merging it.\n' > pr_body | ||
export pr_body=$(cat pr_body) ; gh pr create --base master --title "docs: clean up librarium unused images " --body "$pr_body" | ||
env: | ||
GH_TOKEN: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }} | ||
|
||
|
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,4 @@ | ||
line1 | ||
line2 | ||
line3 | ||
|
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 @@ | ||
|
||
## Describe the Change | ||
|
||
This PR removes images identified as unused across all our branches. | ||
|
||
The images are identified using `scripts/find-unused-images.sh` script. | ||
|
||
Please review this PR carefully before merging it. | ||
|