Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/AY-6086_adding-parents-to-tem…
Browse files Browse the repository at this point in the history
…plate-keys
  • Loading branch information
iLLiCiTiT authored Dec 4, 2024
2 parents 7d00144 + 230ae53 commit 1094310
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 16 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/assign_pr_to_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,46 @@ on:
workflow_dispatch:
inputs:
pr_number:
type: number
type: string
description: "Run workflow for this PR number"
required: true
project_id:
type: number
type: string
description: "Github Project Number"
required: true
default: 16
default: "16"
pull_request:
types:
- opened

env:
GH_TOKEN: ${{ github.token }}

jobs:
get-pr-repo:
runs-on: ubuntu-latest
outputs:
pr_repo_name: ${{ steps.get-repo-name.outputs.repo_name || github.event.pull_request.head.repo.full_name }}

# INFO `github.event.pull_request.head.repo.full_name` is not available on manual triggered (dispatched) runs
steps:
- name: Get PR repo name
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get-repo-name
run: |
repo_name=$(gh pr view ${{ inputs.pr_number }} --json headRepository,headRepositoryOwner --repo ${{ github.repository }} | jq -r '.headRepositoryOwner.login + "/" + .headRepository.name')
echo "repo_name=$repo_name" >> $GITHUB_OUTPUT
auto-assign-pr:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
needs:
- get-pr-repo
if: ${{ needs.get-pr-repo.outputs.pr_repo_name == github.repository }}
uses: ynput/ops-repo-automation/.github/workflows/pr_to_project.yml@main
with:
repo: "${{ github.repository }}"
project_id: "${{ inputs.project_id }}"
pull_request_number: "${{ github.event.pull_request.number || inputs.pr_number }}"
project_id: ${{ inputs.project_id != '' && fromJSON(inputs.project_id) || 16 }}
pull_request_number: ${{ github.event.pull_request.number || fromJSON(inputs.pr_number) }}
secrets:
token: ${{ secrets.YNPUT_BOT_TOKEN }}
# INFO fallback to default `github.token` is required for PRs from forks
# INFO organization secrets won't be available to forks
token: ${{ secrets.YNPUT_BOT_TOKEN || github.token}}
19 changes: 13 additions & 6 deletions client/ayon_core/plugins/publish/collect_farm_env_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pyblish.api

from ayon_core.lib import get_ayon_username
from ayon_core.pipeline.publish import FARM_JOB_ENV_DATA_KEY


Expand All @@ -15,16 +16,22 @@ def process(self, context):
env = context.data.setdefault(FARM_JOB_ENV_DATA_KEY, {})

# Disable colored logs on farm
env["AYON_LOG_NO_COLORS"] = "1"
for key, value in (
("AYON_LOG_NO_COLORS", "1"),
("AYON_PROJECT_NAME", context.data["projectName"]),
("AYON_FOLDER_PATH", context.data.get("folderPath")),
("AYON_TASK_NAME", context.data.get("task")),
# NOTE we should use 'context.data["user"]' but that has higher
# order.
("AYON_USERNAME", get_ayon_username()),
):
if value:
self.log.debug(f"Setting job env: {key}: {value}")
env[key] = value

for key in [
"AYON_BUNDLE_NAME",
"AYON_DEFAULT_SETTINGS_VARIANT",
"AYON_USERNAME",
"AYON_PROJECT_NAME",
"AYON_FOLDER_PATH",
"AYON_TASK_NAME",
"AYON_LOG_NO_COLORS",
"AYON_IN_TESTS",
# NOTE Not sure why workdir is needed?
"AYON_WORKDIR",
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_core/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring AYON addon 'core' version."""
__version__ = "1.0.9+dev"
__version__ = "1.0.10+dev"
2 changes: 1 addition & 1 deletion package.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "core"
title = "Core"
version = "1.0.9+dev"
version = "1.0.10+dev"

client_dir = "ayon_core"

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[tool.poetry]
name = "ayon-core"
version = "1.0.9+dev"
version = "1.0.10+dev"
description = ""
authors = ["Ynput Team <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 1094310

Please sign in to comment.