Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:

- name: checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Get current or bumped version tag
id: bumpVersion
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/shared-build-deploy-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
tagPrefix: ${{ steps.load-environment.outputs.tagPrefix }}
steps:
- name: Checkout calling repo
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Checkout trakx/github-actions repo
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
repository: trakx/github-actions
path: ./github-actions-shared-build-deploy-container
Expand Down Expand Up @@ -101,10 +101,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout calling repo
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Checkout trakx/github-actions repo
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
repository: trakx/github-actions
path: ./github-actions-shared-build-deploy-container
Expand Down Expand Up @@ -143,10 +143,10 @@ jobs:
&& github.event.workflow_run.conclusion == 'success' ))
steps:
- name: Checkout calling repo
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Checkout trakx/github-actions repo
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
repository: trakx/github-actions
path: ./github-actions-shared-build-deploy-container
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/shared-deploy-container-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
runnerName: ${{ steps.load-environment.outputs.runnerName }}
steps:
- name: Checkout calling repo
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Checkout trakx/github-actions repo
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
repository: trakx/github-actions
path: ./github-actions-shared-deploy-image
Expand Down Expand Up @@ -103,10 +103,10 @@ jobs:
runs-on: ${{ needs.prepare-and-validate.outputs.runnerName }}
steps:
- name: Checkout calling repo
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Checkout trakx/github-actions repo
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
repository: trakx/github-actions
path: ./github-actions-shared-deploy-image
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:

- name: checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Get current or bumped version tag
id: bumpVersion
Expand Down
58 changes: 50 additions & 8 deletions restore-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,53 @@ runs:
with:
dotnet-version: ${{ inputs.dotnetVersion }}

- name: Add Trakx github nuget source
- name: Ensure Trakx GitHub Packages source exists and has credentials
shell: bash
run: dotnet nuget add source "https://nuget.pkg.github.com/trakx/index.json"
--name "github"
--username "trakx-bot"
--password ${{inputs.packageReadonlyPat}}
--store-password-in-clear-text
env:
PACKAGE_READONLY_PAT: ${{ inputs.packageReadonlyPat }}
run: |
set -euo pipefail

FEED_URL="https://nuget.pkg.github.com/trakx/index.json"
FEED_FALLBACK_NAME="github"
FEED_USERNAME="trakx-bot"

get_nuget_source_name_by_url() {
local source_url="$1"
dotnet nuget list source \
| awk -v url="$source_url" '
match($0, /^[[:space:]]*[0-9]+[.][[:space:]]*(.+)[[:space:]]+\[(Enabled|Disabled)\][[:space:]]*$/, m) {
name=m[1]
status=m[2]
next
}
index($0, url) && status=="Enabled" {
print name
exit
}
'
}

FEED_NAME="$(get_nuget_source_name_by_url "$FEED_URL" || true)"

if [ -n "${FEED_NAME:-}" ]; then
echo "GitHub feed already configured as '$FEED_NAME'. Updating credentials."
echo "ADDED_GITHUB_SOURCE=false" >> "$GITHUB_ENV"

dotnet nuget update source "$FEED_NAME" \
--username "$FEED_USERNAME" \
--password "$PACKAGE_READONLY_PAT" \
--store-password-in-clear-text
else
echo "GitHub feed not configured. Adding as '$FEED_FALLBACK_NAME'."
echo "ADDED_GITHUB_SOURCE=true" >> "$GITHUB_ENV"

dotnet nuget add source "$FEED_URL" \
--name "$FEED_FALLBACK_NAME" \
--username "$FEED_USERNAME" \
--password "$PACKAGE_READONLY_PAT" \
--store-password-in-clear-text
fi

- name: Restore Cache
uses: actions/cache@v4
Expand All @@ -39,8 +79,10 @@ runs:
shell: bash
env:
DOTNET_NUGET_SIGNATURE_VERIFICATION: false
NUGET_AUTH_TOKEN: ${{ inputs.packageReadonlyPat }}
run: dotnet restore --locked-mode

- name: Remove Trakx github source
- name: Remove Trakx github source (only if action added it)
if: env.ADDED_GITHUB_SOURCE == 'true'
shell: bash
run: dotnet nuget remove source "github"
run: dotnet nuget remove source "github" || true
Loading