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

Split workitem validation and labeling workflows #2960

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aholstrup1
Copy link
Contributor

@aholstrup1 aholstrup1 commented Feb 14, 2025

Summary

Split workitem validation and labeling workflows

Work Item(s)

Fixes AB#565728

@aholstrup1 aholstrup1 requested a review from a team as a code owner February 14, 2025 07:13
@github-actions github-actions bot added Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files labels Feb 14, 2025
@github-actions github-actions bot added this to the Version 26.0 milestone Feb 14, 2025
shell: pwsh

jobs:
GitHubIssueValidation:
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be a check here that the parent workflow was successful?

# If the pull request is not from a fork, add a comment to the pull request
if (-not $PullRequest.IsFromFork()) {
# If the pull request is not from a fork and not validate only, add a comment
if (-not $PullRequest.IsFromFork() -and -not $ValidateOnly) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The pull requests: write permissions are only needed to add the comment, right?

How about we scratch that part? The workflow error should be descriptive enough.

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
build/scripts/PullRequestValidation/ValidateInternalWorkItemForPullRequest.ps1 -PullRequestNumber ${{github.event.workflow_run.pull_requests[0].number}} -Repository ${{ github.repository }}
- name: Add Linked label to PR
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- name: Add Linked label to PR
- name: Add Linked label to PR

run: |
build/scripts/PullRequestValidation/AddMilestoneToPullRequest.ps1 -PullRequestNumber ${{github.event.workflow_run.pull_requests[0].number}} -Repository ${{ github.repository }}
Label:
name: 'Label pull request'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the same workflow, can't the two jobs be consolidated as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants