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

Respect original content when creating secrets (#24745) #24746

Merged
merged 1 commit into from
May 16, 2023

Conversation

GiteaBot
Copy link
Contributor

Backport #24745 by @wolfogre

Fix #24721.

Follow what GitHub does:

  • Don't trim spaces for secrets.
  • Newline should be \n instead of \r\n.

Did some tests with:

name: secrets
on: push
jobs:
  show_secrets:
    runs-on: ubuntu-latest
    steps:
      - name: Dump secrets context
        run: echo '${{ toJSON(secrets) }}' | base64

AAAAAA:

   AAAAAA
AAAAAA


BBBBBB:




BBBBBB
BBBBBB   

On GitHub:

image

On Gitea (before):

image

On Gitea (after):

image

Fix go-gitea#24721.

Follow what GitHub does:
- Don't trim spaces for secrets.
- Newline should be `\n` instead of `\r\n`.

Did some tests with:

```yaml
name: secrets
on: push
jobs:
  show_secrets:
    runs-on: ubuntu-latest
    steps:
      - name: Dump secrets context
        run: echo '${{ toJSON(secrets) }}' | base64
```

`AAAAAA`:
```text
   AAAAAA
AAAAAA


```
`BBBBBB`:
```text



BBBBBB
BBBBBB   
```


On GitHub:

<img width="675" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/0ec60652-c2a3-47bb-9f9d-7e81665355a8">


On Gitea (before):

<img width="673" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/cce818bf-5edc-4656-86e1-2c81c304cdb2">

On Gitea (after):

<img width="673" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/0b3b15af-4d48-4bab-a334-4738a1b0eb4a">
@GiteaBot GiteaBot added type/bug topic/gitea-actions related to the actions of Gitea labels May 16, 2023
@GiteaBot GiteaBot added this to the 1.19.4 milestone May 16, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 16, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 16, 2023
@GiteaBot GiteaBot requested review from lunny and wxiaoguang May 16, 2023 06:49
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 16, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 16, 2023
@silverwind silverwind enabled auto-merge (squash) May 16, 2023 07:07
@silverwind silverwind merged commit e4f200e into go-gitea:release/v1.19 May 16, 2023
Codeberg-org pushed a commit to Codeberg-org/gitea that referenced this pull request Jun 3, 2023
…itea#24746)

Backport go-gitea#24745 by @wolfogre

Fix go-gitea#24721.

Follow what GitHub does:
- Don't trim spaces for secrets.
- Newline should be `\n` instead of `\r\n`.

Did some tests with:

```yaml
name: secrets
on: push
jobs:
  show_secrets:
    runs-on: ubuntu-latest
    steps:
      - name: Dump secrets context
        run: echo '${{ toJSON(secrets) }}' | base64
```

`AAAAAA`:
```text
   AAAAAA
AAAAAA

```
`BBBBBB`:
```text

BBBBBB
BBBBBB
```

On GitHub:

<img width="675" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/0ec60652-c2a3-47bb-9f9d-7e81665355a8">

On Gitea (before):

<img width="673" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/cce818bf-5edc-4656-86e1-2c81c304cdb2">

On Gitea (after):

<img width="673" alt="image"
src="https://github.com/go-gitea/gitea/assets/9418365/0b3b15af-4d48-4bab-a334-4738a1b0eb4a">

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit e4f200e)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 14, 2023
@techknowlogick techknowlogick deleted the backport-24745-v1.19 branch September 9, 2023 05:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. topic/gitea-actions related to the actions of Gitea type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants