Skip to content

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

Merged
skjnldsv merged 2 commits into
stable27from
fix/cypress-ref/stable27
Jun 29, 2023
Merged

[stable27] fix(cypress): branch definition#39067
skjnldsv merged 2 commits into
stable27from
fix/cypress-ref/stable27

Conversation

@skjnldsv

@skjnldsvskjnldsv commented Jun 29, 2023

Copy link
Copy Markdown
Member

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_namestring 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_refstring 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.

@skjnldsvskjnldsv added this to the Nextcloud 27.0.1 milestone Jun 29, 2023
@skjnldsvskjnldsv self-assigned this Jun 29, 2023
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
@skjnldsv
skjnldsvforce-pushed the fix/cypress-ref/stable27 branch from 3ca1585 to 772aa81CompareJune 29, 2023 15:24
@skjnldsv

Copy link
Copy Markdown
MemberAuthor

/backport to stable26

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

/backport to master

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

Seems to work! 👍
image

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

@AntreesyAntreesy left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
MemberAuthor

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: {

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
@skjnldsv
skjnldsvforce-pushed the fix/cypress-ref/stable27 branch from 5ec1434 to 16c7c07CompareJune 29, 2023 16:19
@skjnldsv
skjnldsv merged commit de6d5b6 into stable27Jun 29, 2023
@skjnldsv
skjnldsv deleted the fix/cypress-ref/stable27 branch June 29, 2023 16:39
@skjnldsv

Copy link
Copy Markdown
MemberAuthor

This is a different issue :)

Maybe not, let's see

@skjnldsv

Copy link
Copy Markdown
MemberAuthor

@backportbot-nextcloud

This comment was marked as resolved.

@blizzzblizzz mentioned this pull request Jul 10, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbugregression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@skjnldsv@Pytal@Antreesy