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

[stable27] fix(cypress): branch definition #39067

Merged
merged 2 commits into from
Jun 29, 2023
Merged

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Jun 29, 2023

https://docs.github.com/en/actions/learn-github-actions/contexts#github-context

env:
 BRANCH_NAME: ${{ github.base_ref || github.ref_name }} 

Explanation

The trick is that github.base_ref is only set when the workflow was triggered by a pull_request and it contains the value of the source branch of the PR. github.ref_name will than only be used if the workflow was not triggered by a pull_request and it also just contains the branch name.

GitHub Documentation

Detailed explanation from official GitHub docs:

github.ref_name string The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1.

github.base_ref string The base_ref or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.

@skjnldsv skjnldsv added this to the Nextcloud 27.0.1 milestone Jun 29, 2023
@skjnldsv skjnldsv self-assigned this Jun 29, 2023
Signed-off-by: John Molakvoæ <[email protected]>
@skjnldsv skjnldsv force-pushed the fix/cypress-ref/stable27 branch from 3ca1585 to 772aa81 Compare June 29, 2023 15:24
@skjnldsv
Copy link
Member Author

/backport to stable26

@skjnldsv
Copy link
Member Author

/backport to master

@skjnldsv
Copy link
Member Author

Seems to work! 👍
image

@skjnldsv skjnldsv requested review from susnux, artonge, Antreesy, a team and Pytal and removed request for a team June 29, 2023 15:32
Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

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

🦭

Seems to work! +1

Saw that also in my backport: https://github.com/nextcloud/server/actions/runs/5409725309/jobs/9833992543?pr=39055#step:5:146

Let's see if it will help

@skjnldsv
Copy link
Member Author

Saw that also in my backport: nextcloud/server/actions/runs/5409725309/jobs/9833992543?pr=39055#step:5:146

This is a different issue :)

The request we sent was:

Method: GET
URL: http://172.17.0.2/index.php/csrftoken
Headers: {
  "Connection": "keep-alive",
  "user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/12.11.0 Chrome/106.0.5249.51 Electron/21.0.0 Safari/537.36",
  "accept": "*/*",
  "accept-encoding": "gzip, deflate"
}

-----------------------------------------------------------

The response we got was:

Status: 503 - Service Unavailable
Headers: {

@skjnldsv skjnldsv force-pushed the fix/cypress-ref/stable27 branch from 5ec1434 to 16c7c07 Compare June 29, 2023 16:19
@skjnldsv skjnldsv merged commit de6d5b6 into stable27 Jun 29, 2023
@skjnldsv skjnldsv deleted the fix/cypress-ref/stable27 branch June 29, 2023 16:39
@skjnldsv
Copy link
Member Author

This is a different issue :)

Maybe not, let's see

@skjnldsv
Copy link
Member Author

@backportbot-nextcloud

This comment was marked as resolved.

@blizzz blizzz mentioned this pull request Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants