Skip to content

Commit

Permalink
Merge pull request #33 from eMoflon/hotfix/extend-github-api-requests
Browse files Browse the repository at this point in the history
Extend GitHub API requests with a valid token
  • Loading branch information
maxkratz authored Mar 10, 2023
2 parents 4b10eeb + ab8f4d9 commit 89729ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/vagrant-up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
run: |
vagrant up
echo "=> Vagrant run finished."
env:
GITHUB_TOKEN: ${{ github.token }}
- name: export virtualbox VM
run: |
vagrant halt
Expand Down
6 changes: 4 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
token = ENV["GITHUB_TOKEN"]

Vagrant.configure("2") do |config|
config.vm.box = "gusztavvargadr/ubuntu-desktop-2004-lts-xfce"
config.vm.define 'ubuntu'
config.vm.define 'emoflon'
config.vm.provider :virtualbox do |vb|
vb.name = "emoflon"
vb.memory = 8192
vb.cpus = 2
end
config.vm.provision "shell", path: "prov.sh", privileged: false
config.vm.provision "shell", path: "prov.sh", env: {"GITHUB_TOKEN" => token}, privileged: false

# Prevent SharedFoldersEnableSymlinksCreate errors
config.vm.synced_folder ".", "/vagrant", disabled: true
Expand Down
5 changes: 3 additions & 2 deletions prov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ cd ~/eclipse-apps
# Get eclipse
if [[ ! -f "./$ECLIPSE_ARCHIVE.zip" ]]; then
log "Downloading latest eMoflon Eclipse archive from Github."
curl -s https://api.github.com/repos/eMoflon/emoflon-ibex-eclipse-build/releases/latest \
curl -s --header "Authorization: Bearer ${GITHUB_TOKEN}" \
https://api.github.com/repos/eMoflon/emoflon-ibex-eclipse-build/releases/latest \
| grep "$ECLIPSE_ARCHIVE.zip" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -q -i - \
| wget -q --header="Authorization: Bearer ${GITHUB_TOKEN}" -i - \
|| :
fi

Expand Down

0 comments on commit 89729ca

Please sign in to comment.