Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ExplodingDragon authored Jul 18, 2023
2 parents 36588d8 + 8bb0a03 commit fa52a17
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
4 changes: 3 additions & 1 deletion contrib/environment-to-ini/environment-to-ini.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func main() {
}

func runEnvironmentToIni(c *cli.Context) error {
// the config system may change the environment variables, so get a copy first, to be used later
env := append([]string{}, os.Environ()...)
setting.InitWorkPathAndCfgProvider(os.Getenv, setting.ArgWorkPathAndCustomConf{
WorkPath: c.String("work-path"),
CustomPath: c.String("custom-path"),
Expand All @@ -86,7 +88,7 @@ func runEnvironmentToIni(c *cli.Context) error {
log.Fatal("Failed to load custom conf '%s': %v", setting.CustomConf, err)
}

changed := setting.EnvironmentToConfig(cfg, os.Environ())
changed := setting.EnvironmentToConfig(cfg, env)

// try to save the config file
destination := c.String("out")
Expand Down
7 changes: 7 additions & 0 deletions routers/web/repo/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"bytes"
"fmt"
"net/http"
"strings"

actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/db"
Expand Down Expand Up @@ -106,6 +107,12 @@ func List(ctx *context.Context) {
for _, j := range wf.Jobs {
runsOnList := j.RunsOn()
for _, ro := range runsOnList {
if strings.Contains(ro, "${{") {
// Skip if it contains expressions.
// The expressions could be very complex and could not be evaluated here,
// so just skip it, it's OK since it's just a tooltip message.
continue
}
if !allRunnerLabels.Contains(ro) {
workflow.ErrMsg = ctx.Locale.Tr("actions.runs.no_matching_runner_helper", ro)
break
Expand Down
6 changes: 3 additions & 3 deletions web_src/js/features/repo-issue-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import $ from 'jquery';
import {updateIssuesMeta} from './repo-issue.js';
import {toggleElem} from '../utils/dom.js';
import {htmlEscape} from 'escape-goat';
import {Sortable} from 'sortablejs';
import {confirmModal} from './comp/ConfirmModal.js';
import {showErrorToast} from '../modules/toast.js';
import {createSortable} from '../modules/sortable.js';

function initRepoIssueListCheckboxes() {
const $issueSelectAll = $('.issue-checkbox-all');
Expand Down Expand Up @@ -176,7 +176,7 @@ async function pinMoveEnd(e) {
});
}

function initIssuePinSort() {
async function initIssuePinSort() {
const pinDiv = document.getElementById('issue-pins');

if (pinDiv === null) return;
Expand All @@ -189,7 +189,7 @@ function initIssuePinSort() {
// If only one issue pinned, we don't need to make this Sortable
if (pinDiv.children.length < 2) return;

new Sortable(pinDiv, {
createSortable(pinDiv, {
group: 'shared',
animation: 150,
ghostClass: 'card-ghost',
Expand Down
7 changes: 3 additions & 4 deletions web_src/js/features/repo-projects.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import $ from 'jquery';
import {useLightTextOnBackground} from '../utils/color.js';
import tinycolor from 'tinycolor2';
import {createSortable} from '../modules/sortable.js';

const {csrfToken} = window.config;

Expand Down Expand Up @@ -55,12 +56,10 @@ async function initRepoProjectSortable() {
const els = document.querySelectorAll('#project-board > .board.sortable');
if (!els.length) return;

const {Sortable} = await import(/* webpackChunkName: "sortable" */'sortablejs');

// the HTML layout is: #project-board > .board > .board-column .board.cards > .board-card.card .content
const mainBoard = els[0];
let boardColumns = mainBoard.getElementsByClassName('board-column');
new Sortable(mainBoard, {
createSortable(mainBoard, {
group: 'board-column',
draggable: '.board-column',
filter: '[data-id="0"]',
Expand Down Expand Up @@ -89,7 +88,7 @@ async function initRepoProjectSortable() {

for (const boardColumn of boardColumns) {
const boardCardList = boardColumn.getElementsByClassName('board')[0];
new Sortable(boardCardList, {
createSortable(boardCardList, {
group: 'shared',
animation: 150,
ghostClass: 'card-ghost',
Expand Down
4 changes: 4 additions & 0 deletions web_src/js/modules/sortable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export async function createSortable(...args) {
const {Sortable} = await import(/* webpackChunkName: "sortablejs" */'sortablejs');
return new Sortable(...args);
}

0 comments on commit fa52a17

Please sign in to comment.