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

Fast-ci.yaml's PostResult job can't handle the character ' in the branch name. #7360

Open
nick4598 opened this issue Nov 13, 2024 · 0 comments
Labels
buildology Issues related to process, tooling or CI/CD pipelines

Comments

@nick4598
Copy link
Contributor

nick4598 commented Nov 13, 2024

It seems if the branch name contains the character ', then it gets ignored when the PostResult job runs in fast-ci.yaml

- job: PostResult
dependsOn:
- CheckLinkedPR
- Build
condition: and(succeeded(), eq(dependencies.CheckLinkedPR.outputs['checkForPr.POST_STATUS'], 'true'), eq(variables['Build.Reason'], 'PullRequest'))
displayName: Post Success
pool:
vmImage: ubuntu-latest
steps:
- bash: |
branch=$(System.PullRequest.SourceBranch)
sha=$(gh pr view $branch --json "headRefOid" -q ".headRefOid")
echo "Posting 'success' status to current PR"
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/$(Build.Repository.Name)/statuses/$sha \
-f state='success' \
-f target_url='$(BUILD_URL)' \
-f context='itwinjs-core PR validation' \
-f description='No native PR was linked'
env:
GITHUB_TOKEN: $(GH_TOKEN)

This results in a 404 as seen below:

Image

Screenshot of the PR branch name
Image

Link to PR: #7351

If git allows ' in the branch name, then our PostResult job should also handle it. After looking at the yaml step more closely though, its possible $(System.PullRequest.SourceBranch) is actually where the bug is occurring. In that case it may be out of our control.

@nick4598 nick4598 added the buildology Issues related to process, tooling or CI/CD pipelines label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buildology Issues related to process, tooling or CI/CD pipelines
Projects
None yet
Development

No branches or pull requests

1 participant