Skip to content

Commit

Permalink
Merge pull request #51 from bci-oss/bug/fix-semantic-hub-sync-workflow
Browse files Browse the repository at this point in the history
Fix problem with using old octocat api
  • Loading branch information
tunacicek authored Feb 1, 2023
2 parents 185112e + 5cf83af commit dff87bd
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/upload.yml
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

Expand All @@ -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,
Expand All @@ -57,7 +55,6 @@ jobs:
- run: |
unzip output.zip
cat output.json
- name: Fetch Access Token
id: token_request
env:
Expand All @@ -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
Expand Down

0 comments on commit dff87bd

Please sign in to comment.