Skip to content

ci: add e2e

ci: add e2e #92

Workflow file for this run

name: E2E
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
e2e-default:
runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set labels
run: ./src/labels/set.sh
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LABELS: "component/auth, component/docs"
- name: Test Run
id: test-run
uses: ./
with:
placeholder: "test_placeholder"
- name: Get labels
id: get-labels
run: |
labels=$(gh api repos/${{ github.repository }}/issues/${{ github.event.number }}/labels | jq -r '.[].name')
{
echo "labels<<EOF"
echo "$labels"
echo "EOF"
} >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Assert placeholder
uses: nick-fields/assert-action@v2
with:
actual: ${{ steps.get-labels.outputs.labels }}
expected: |
component/auth
component/docs
- name: Cleanup
run: |
gh api repos/${{ github.repository }}/issues/${{ github.event.number }}/labels \
--field "labels[]=component/auth" \
--field "labels[]=component/docs" \
--method DELETE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}