Skip to content

Update dependency @types/node to v20.8.9 (#1190) #85

Update dependency @types/node to v20.8.9 (#1190)

Update dependency @types/node to v20.8.9 (#1190) #85

name: delete-pull-request-namespaces
on:
pull_request:
paths:
- delete-pull-request-namespaces/**
- '*.json'
- .github/workflows/delete-pull-request-namespaces.yaml
push:
branches:
- main
paths:
- delete-pull-request-namespaces/**
- '*.json'
- .github/workflows/delete-pull-request-namespaces.yaml
concurrency:
group: ${{ github.workflow }}--${{ github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: delete-pull-request-namespaces
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 20
cache: yarn
- run: yarn
- run: yarn test
e2e-test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 20
cache: yarn
- run: yarn
- run: yarn build
- run: yarn package
- run: |
git config --global user.email '[email protected]'
git config --global user.name 'github-actions'
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.head_ref }} # avoid "shallow update not allowed" error
path: overlay-branch
- name: Set up an overlay branch
working-directory: overlay-branch
run: |
mkdir -vp monorepo-deploy-actions/overlay-${{ github.run_id }}
cd monorepo-deploy-actions/overlay-${{ github.run_id }}
touch pr-1.yaml
touch pr-2.yaml
touch pr-${{ github.event.pull_request.number }}.yaml
git add .
git commit -m "Add overlay branch for e2e-test of ${GITHUB_REF}"
git push origin "HEAD:refs/heads/delete-pull-request-namespaces-${{ github.run_id }}"
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.head_ref }} # avoid "shallow update not allowed" error
path: namespace-branch
- name: Set up an namespace branch
working-directory: namespace-branch
run: |
touch dummy
git add .
git commit -m "Add namespace branch for e2e-test of ${GITHUB_REF}"
git push origin "HEAD:refs/heads/ns/monorepo-deploy-actions/overlay-${{ github.run_id }}/pr-${{ github.event.pull_request.number }}"
- uses: ./delete-pull-request-namespaces
id: delete-pull-request-namespaces
with:
overlay: overlay-${{ github.run_id }}
namespace-prefix: pr-
destination-repository: ${{ github.repository }}
destination-branch: delete-pull-request-namespaces-${{ github.run_id }}
exclude-label: skip-nightly-stop
remove-label-on-deletion: deploy
- name: Clean up the overlay branch
continue-on-error: true
if: always()
run: |
git push origin --delete "refs/heads/delete-pull-request-namespaces-${{ github.run_id }}"
- name: Clean up the namespace branch
continue-on-error: true
if: always()
run: |
git push origin --delete "refs/heads/ns/monorepo-deploy-actions/overlay-${{ github.run_id }}/pr-${{ github.event.pull_request.number }}"