-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from bci-oss/bug/fix-semantic-hub-sync-workflow
Fix problem with using old octocat api
- Loading branch information
Showing
1 changed file
with
11 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
####################################################################### | ||
# | ||
# Copyright (c) 2021 T-Systems International GmbH (Catena-X Consortium) | ||
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# See the AUTHORS file(s) distributed with this work for additional | ||
# information regarding authorship. | ||
# | ||
# This work is made available under the terms of the | ||
# Creative Commons Attribution 4.0 International (CC-BY-4.0) license, | ||
# which is available at | ||
# https://creativecommons.org/licenses/by/4.0/legalcode. | ||
# See the LICENSE file(s) distributed with this work for | ||
# additional information regarding license terms. | ||
# | ||
# SPDX-License-Identifier: CC-BY-4.0 | ||
####################################################################### | ||
|
||
name: 1 Upload | ||
|
||
|
@@ -26,27 +22,29 @@ jobs: | |
upload-models: | ||
name: 00 Upload Models | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
actions: read | ||
steps: | ||
- name: set environment variables | ||
run: | | ||
echo "WORKSPACE_UPPERCASE=INT" >> $GITHUB_ENV | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download artifact | ||
uses: actions/[email protected] | ||
with: | ||
script: | | ||
var artifacts = await github.actions.listWorkflowRunArtifacts({ | ||
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: ${{github.event.workflow_run.id }}, | ||
}); | ||
var matchArtifact = artifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "output" | ||
})[0]; | ||
var download = await github.actions.downloadArtifact({ | ||
var download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
|
@@ -57,7 +55,6 @@ jobs: | |
- run: | | ||
unzip output.zip | ||
cat output.json | ||
- name: Fetch Access Token | ||
id: token_request | ||
env: | ||
|
@@ -72,13 +69,11 @@ jobs: | |
--data-urlencode client_id=$CLIENT_ID \ | ||
--data-urlencode client_secret=$CLIENT_SECRET ) | ||
access_token=$( echo $response | jq -r '.access_token' ) | ||
if [ $access_token == null ] | ||
then | ||
echo "Error: Got empty token" | ||
exit 1 | ||
fi | ||
echo "ACCESS_TOKEN=$access_token" >> $GITHUB_ENV | ||
- name: Upload | ||
|