Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add e2e for sinchronize pr with label #12

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,51 @@ jobs:
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

e2e-with-single-label:
runs-on: ubuntu-20.04
needs: [e2e-no-labels]

permissions:
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set labels
run: ./src/labels/set.sh
env:
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LABELS: |
type/fix

- name: Test Run
id: test-run
uses: ./
with:
github_pr_title: "fix: esli b mishki bili b pchelami"

- name: Get labels
id: get-labels
run: ./src/labels/get.sh
env:
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Assert placeholder
uses: nick-fields/assert-action@v2
with:
actual: ${{ steps.get-labels.outputs.labels }}
expected: |
type/fix

- name: Delete all labels
run: ./src/labels/delete_all.sh
env:
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion src/construct_labels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TYPE_LABELS_PREFIX=$(echo "$CONFIG_DATA" | jq -r '.section_tags.prefix')
COMPONENT_LABELS_PREFIX=$(echo "$CONFIG_DATA" | jq -r '.component_tags.prefix')

if [[ -n $CURRENT_LABELS ]]; then
OTHER_LABELS=$(echo "$CURRENT_LABELS" | grep -Ev "$TYPE_LABELS_PREFIX|$COMPONENT_LABELS_PREFIX" | sort)
OTHER_LABELS=$(echo "$CURRENT_LABELS" | grep -Ev "$TYPE_LABELS_PREFIX|$COMPONENT_LABELS_PREFIX" || true | sort)
CURRENT_LABELS=$(echo "$CURRENT_LABELS" | grep -E "$TYPE_LABELS_PREFIX|$COMPONENT_LABELS_PREFIX" | sort)
fi

Expand Down
Loading