Skip to content

custom-upgrade-awscli-v2-main #319

custom-upgrade-awscli-v2-main

custom-upgrade-awscli-v2-main #319

name: custom-upgrade-awscli-v2-main
on:
workflow_dispatch: {}
schedule:
- cron: 0 0 * * *
jobs:
upgrade:
name: Upgrade
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
patch_created: ${{ steps.create_patch.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: awscli-v2/main
- name: Change permissions on /var/run/docker.sock
run: sudo chown superchain /var/run/docker.sock
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Install Python Script Dependencies
run: |
sudo apt update
sudo apt install -y jq
- name: Check for awscli version upgrades
run: |
cd .github/scripts
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
python3 upgrade-awscli-version.py
- id: create_patch
name: Find mutations
run: |-
git add .
git diff --staged --patch --exit-code > .repo.patch || echo "::set-output name=patch_created::true"
- if: steps.create_patch.outputs.patch_created
name: Upload patch
uses: actions/upload-artifact@v2
with:
name: .repo.patch
path: .repo.patch
container:
image: jsii/superchain:1-buster-slim-node18
options: --group-add sudo
pr:
name: Create Pull Request
needs: upgrade
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: ${{ needs.upgrade.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
ref: awscli-v2/main
- name: Download patch
uses: actions/download-artifact@v3
with:
name: .repo.patch
path: ${{ runner.temp }}
- name: Apply patch
run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."'
- name: Set git identity
run: |-
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
commit-message: |-
chore(deps): upgrade dependencies
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
branch: github-actions/upgrade-awscli-v2-main
title: "chore(deps): upgrade aws-cli dependency"
labels: auto-approve
body: |-
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
author: github-actions <[email protected]>
committer: github-actions <[email protected]>
signoff: true