Skip to content

Commit

Permalink
Fix upload metadata workflow (#301)
Browse files Browse the repository at this point in the history
* Add logging

* Should not upload metadata automatically
  • Loading branch information
shenglol authored Mar 31, 2023
1 parent 2df62d9 commit c9f2145
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/on-push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,3 @@ jobs:
PUBLISH_TENANT_ID: ${{ secrets.PUBLISH_TENANT_ID }}
PUBLISH_SUBSCRIPTION_ID: ${{ secrets.PUBLISH_SUBSCRIPTION_ID }}
PUBLISH_REGISTRY_SERVER: ${{ secrets.PUBLISH_REGISTRY_SERVER }}

upload-modules-metadata:
uses: ./.github/workflows/upload-modules-metadata.yml
secrets:
CLIENT_ID: ${{ secrets.PUBLISH_CLIENT_ID }}
TENANT_ID: ${{ secrets.PUBLISH_TENANT_ID }}
SUBSCRIPTION_ID: ${{ secrets.PUBLISH_SUBSCRIPTION_ID }}
15 changes: 3 additions & 12 deletions .github/workflows/upload-modules-metadata.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
name: Upload modules metadata
on:
workflow_call:
secrets:
# Secrets must be passed from the caller workflow explicitly.
CLIENT_ID:
required: true
TENANT_ID:
required: true
SUBSCRIPTION_ID:
required: true
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -42,9 +33,9 @@ jobs:
- name: Log in to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION_ID }}
client-id: ${{ secrets.PUBLISH_CLIENT_ID }}
tenant-id: ${{ secrets.PUBLISH_TENANT_ID }}
subscription-id: ${{ secrets.PUBLISH_SUBSCRIPTION_ID }}

- name: Upload to blob storage
uses: azure/CLI@v1
Expand Down
1 change: 1 addition & 0 deletions scripts/github-actions/refresh-module-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async function generateModulesTable(require, axios, fs, path, core) {

try {
core.info(`Getting ${modulePath}...`);

const versionListResponse = await axios.get(versionListUrl);
const latestVersion = versionListResponse.data.tags.sort().at(-1);
const badgeUrl = `https://img.shields.io/badge/mcr-${latestVersion}-blue`;
Expand Down
2 changes: 1 addition & 1 deletion scripts/github-actions/upload-modules-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function uploadModulesMetadata({ require, core }) {
try {
core.info(`Getting ${modulePath}...`);

const versionListResponse = await axios.default.get(versionListUrl);
const versionListResponse = await axios.get(versionListUrl);
const tags = versionListResponse.data.tags.sort();

result.push({
Expand Down

0 comments on commit c9f2145

Please sign in to comment.