Skip to content

[Feature Request]: Hide menu bar icons on inactive displays #178

[Feature Request]: Hide menu bar icons on inactive displays

[Feature Request]: Hide menu bar icons on inactive displays #178

Workflow file for this run

name: PR Command Trigger
on:
issue_comment:
types: [created]
jobs:
trigger-build:
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '.build')
runs-on: ubuntu-slim
permissions:
actions: write
issues: write
pull-requests: write
steps:
- name: Parse command
id: command
uses: github/command@76d69a2a6b747d621fba374d707409f89114c620
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
command: ".build"
permissions: write
- name: Get PR Details
if: steps.command.outputs.continue == 'true'
id: get-branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_URL="${{ github.event.issue.pull_request.url }}"
PR_BRANCH=$(gh api "$PR_URL" --jq '.head.ref')
PR_HEAD_REPO=$(gh api "$PR_URL" --jq '.head.repo.full_name')
SAME_REPO=false
if [ "$PR_HEAD_REPO" = "${{ github.repository }}" ]; then
SAME_REPO=true
fi
echo "branch=$PR_BRANCH" >> $GITHUB_OUTPUT
echo "same_repo=$SAME_REPO" >> $GITHUB_OUTPUT
echo "Detected branch: $PR_BRANCH"
echo "PR head repository: $PR_HEAD_REPO"
- name: Trigger Build DMG Workflow
if: steps.command.outputs.continue == 'true' && steps.get-branch.outputs.same_repo == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: ${{ steps.get-branch.outputs.branch }}
run: |
gh workflow run build-dmg.yml --ref "$BRANCH" -R "${{ github.repository }}"
- name: Comment on PR
if: steps.command.outputs.continue == 'true' && steps.get-branch.outputs.same_repo == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER="${{ github.event.issue.number }}"
gh pr comment "$PR_NUMBER" --body "Build triggered for branch \`${{ steps.get-branch.outputs.branch }}\`. Check the Actions tab for progress." -R "${{ github.repository }}"
- name: Comment on PR for fork
if: steps.command.outputs.continue == 'true' && steps.get-branch.outputs.same_repo == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER="${{ github.event.issue.number }}"
gh pr comment "$PR_NUMBER" --body "Build was not triggered automatically because this pull request comes from a fork. A maintainer can trigger it manually by running the \`build-dmg\` workflow against branch \`${{ steps.get-branch.outputs.branch }}\`." -R "${{ github.repository }}"