Skip to content

feat(github-actions): remove preview label for non-googlers in pack-and-upload-artifact#3718

Merged
josephperrott merged 3 commits into
angular:mainfrom
josephperrott:remove-preview-label-googlers
Jun 3, 2026
Merged

feat(github-actions): remove preview label for non-googlers in pack-and-upload-artifact#3718
josephperrott merged 3 commits into
angular:mainfrom
josephperrott:remove-preview-label-googlers

Conversation

@josephperrott
Copy link
Copy Markdown
Member

This PR moves the automatic removal of the triggering preview label (e.g. `action: preview`) from `upload-artifacts-to-firebase` into the `pack-and-upload-artifact` action.

Key Changes:

  1. Organized Label-Removal Logic: Added `remove-preview-label.ts` in `pack-and-upload-artifact/lib/` to check if the PR author is not a member of the `googlers` organization using the Angular Robot App's token and safely delete the triggering label.
  2. Self-Contained Gating: Added `if: contains(github.event.pull_request.labels.*.name, inputs.triggering-label)` to all steps in `pack-and-upload-artifact/action.yml` so that the entire action is graceful and skips if the preview trigger label is not present on the PR.
  3. Angular Robot Authentication: Performs all operations with the Angular Robot app token, avoiding the need for a custom GitHub Token passed as input.

@josephperrott josephperrott requested a review from alan-agius4 June 1, 2026 17:15
@angular-robot angular-robot Bot added the detected: feature PR contains a feature commit label Jun 1, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new GitHub Action step to automatically remove the preview trigger label if the PR author is not a member of the googlers organization. The feedback highlights a critical authentication issue in the composite action due to unmapped inputs, and suggests optimizing the workflow by setting and checking a should-preview output to skip subsequent steps when appropriate. Additionally, improvements were suggested to handle potentially null PR authors, ensure robust token revocation in the finally block, and remove a redundant global cache.

Comment thread github-actions/previews/pack-and-upload-artifact/action.yml
Comment thread github-actions/previews/pack-and-upload-artifact/action.yml
Comment thread github-actions/previews/pack-and-upload-artifact/action.yml
Comment thread github-actions/previews/pack-and-upload-artifact/action.yml
Comment thread github-actions/previews/pack-and-upload-artifact/action.yml
@josephperrott josephperrott added the action: merge The PR is ready for merge by the caretaker label Jun 1, 2026
@josephperrott josephperrott merged commit bba3009 into angular:main Jun 3, 2026
16 checks passed
@josephperrott
Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants