You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
Giteabot e4f200e616
Respect original content when creating secrets (#24745) (#24746)
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:

```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>
2 years ago
..
actions Fix run list broken when trigger user deleted (#24706) (#24709) 2 years ago
activities Refactor `setting.Database.UseXXX` to methods (#23354) (#23356) 2 years ago
admin Implement FSFE REUSE for golang files (#21840) 2 years ago
asymkey Refactor the setting to make unit test easier (#22405) 2 years ago
auth Fix 500 error if there is a name conflict when edit authentication source (#23832) (#23852) 2 years ago
avatars Avoid warning for system setting when start up (#23054) (#23116) 2 years ago
db Improve milestone filter on issues page (#22423) (#24440) 2 years ago
dbfs Refactor the setting to make unit test easier (#22405) 2 years ago
fixtures fix: release page for empty or non-existing target (#24659) 2 years ago
git Fix branch protection priority (#24045) (#24061) 2 years ago
issues Refresh the refernce of the closed PR when reopening (#24231) (#24587) 2 years ago
migrations Drop migration for ForeignReference (#23605) (#23666) 2 years ago
organization Fix owner team access mode value in team_unit table (#24224) 2 years ago
packages Use ghost user if package creator does not exist (#23822) (#23915) 2 years ago
perm Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
project Refactor `setting.Database.UseXXX` to methods (#23354) (#23356) 2 years ago
pull refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo fix: release page for empty or non-existing target (#24659) 2 years ago
secret Respect original content when creating secrets (#24745) (#24746) 2 years ago
system Avoid warning for system setting when start up (#23054) (#23116) 2 years ago
unit Rename actions unit to `repo.actions` and add docs for it (#23733) (#23881) 2 years ago
unittest Refactor `setting.Database.UseXXX` to methods (#23354) (#23356) 2 years ago
user Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... (#23874) (#23878) 2 years ago
webhook Support system hook API (#14537) 2 years ago
error.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_generation.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Refactor the setting to make unit test easier (#22405) 2 years ago
migrate.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
migrate_test.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
org.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
org_team.go Remove org users who belong to no teams (#24247) (#24313) 2 years ago
org_team_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
org_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Avoid warning for system setting when start up (#23054) (#23116) 2 years ago
repo_collaboration.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
repo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_transfer.go Always reuse transaction (#22362) 2 years ago
repo_transfer_test.go Rename almost all Ctx functions (#22071) 2 years ago