Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  Fix required error for token name (go-gitea#28267)
  Use appSubUrl for OAuth2 callback URL tip (go-gitea#28266)
  Ignore temporary files for directory size (go-gitea#28265)
  Check for v prefix on tags for release clean name (go-gitea#28257)
  • Loading branch information
zjjhot committed Nov 29, 2023
2 parents acaeefb + 64cd6e8 commit 8bd337f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-tag-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Get cleaned branch name
id: clean_name
run: |
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//')
echo "Cleaned name is ${REF_NAME}"
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
- name: configure aws
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Get cleaned branch name
id: clean_name
run: |
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\/v//' -e 's/release\/v//')
echo "Cleaned name is ${REF_NAME}"
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
- name: configure aws
Expand Down
6 changes: 5 additions & 1 deletion modules/repository/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ func getDirectorySize(path string) (int64, error) {
}
return err
}
if info.IsDir() {

fileName := info.Name()
// Ignore temporary Git files as they will like be missing once info.Info is
// called and cause a disrupt to the whole operation.
if info.IsDir() || strings.HasSuffix(fileName, ".lock") || strings.HasPrefix(filepath.Base(fileName), "tmp_graph") {
return nil
}
f, err := info.Info()
Expand Down
2 changes: 1 addition & 1 deletion services/forms/user_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ func (f *EditVariableForm) Validate(req *http.Request, errs binding.Errors) bind

// NewAccessTokenForm form for creating access token
type NewAccessTokenForm struct {
Name string `binding:"Required;MaxSize(255)"`
Name string `binding:"Required;MaxSize(255)" locale:"settings.token_name"`
Scope []string
}

Expand Down
5 changes: 3 additions & 2 deletions web_src/js/features/admin/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import $ from 'jquery';
import {checkAppUrl} from '../common-global.js';
import {hideElem, showElem, toggleElem} from '../../utils/dom.js';

const {csrfToken} = window.config;
const {csrfToken, appSubUrl} = window.config;

export function initAdminCommon() {
if ($('.page-content.admin').length === 0) {
Expand Down Expand Up @@ -172,7 +172,8 @@ export function initAdminCommon() {

if ($('.admin.authentication').length > 0) {
$('#auth_name').on('input', function () {
$('#oauth2-callback-url').text(`${window.location.origin}/user/oauth2/${encodeURIComponent($(this).val())}/callback`);
// appSubUrl is either empty or is a path that starts with `/` and doesn't have a trailing slash.
$('#oauth2-callback-url').text(`${window.location.origin}${appSubUrl}/user/oauth2/${encodeURIComponent($(this).val())}/callback`);
}).trigger('input');
}

Expand Down

0 comments on commit 8bd337f

Please sign in to comment.