check if new org as needed job #23
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
name: Przetworzenie organizacji | ||
on: | ||
issues: | ||
types: [opened] | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
permissions: | ||
contents: read | ||
issues: write | ||
jobs: | ||
check-if-new-org: | ||
if: contains(github.event.issue.labels.*.name, 'nowa-organizacja') | ||
name: Check if this is new org issue | ||
process-issue-title: | ||
needs: [check-if-new-org] | ||
name: Process new organization | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Ekstrakcja nazwy zgłoszenia | ||
id: name_extraction | ||
run: | | ||
echo "GITHUB_ISSUE_TITLE=$(gh issue view ${{ github.event.issue.number }} --repo ${{ | ||
github.repository }} --json title --template '{{.title}}')" >> $GITHUB_OUTPUT | ||
- name: Parse issue | ||
id: parse | ||
uses: onmax/issue-form-parser@v1.5 | ||
with: | ||
issue_number: ${{ github.event.issue.number }} | ||
- name: Show parsed payload data | ||
run: | | ||
# Using the character `'` to prevent all characters enclosed within | ||
# them from being treated as special characters (e.g. $ or `) | ||
echo '${{ steps.parse.outputs.payload }}' | ||
echo "${{ fromJson(steps.parse.outputs.payload)['Nazwa Twojej organizacji'] }}" | ||
- name: Aktualizacja nazwy zgłoszenia | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
if: steps.name_extraction.outputs.GITHUB_ISSUE_TITLE == '[Nowa Organizacja]' | ||
run: | | ||
gh issue edit --repo "$GITHUB_REPOSITORY" ${{ github.event.issue.number }} --title "[Nowa Organizacja] ${{ fromJson(steps.parse.outputs.payload)['Nazwa Twojej organizacji'] }}" |