Skip to content

Commit 89729ca

Browse files
authored
Merge pull request #33 from eMoflon/hotfix/extend-github-api-requests
Extend GitHub API requests with a valid token
2 parents 4b10eeb + ab8f4d9 commit 89729ca

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.github/workflows/vagrant-up.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
run: |
3838
vagrant up
3939
echo "=> Vagrant run finished."
40+
env:
41+
GITHUB_TOKEN: ${{ github.token }}
4042
- name: export virtualbox VM
4143
run: |
4244
vagrant halt

Vagrantfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
token = ENV["GITHUB_TOKEN"]
2+
13
Vagrant.configure("2") do |config|
24
config.vm.box = "gusztavvargadr/ubuntu-desktop-2004-lts-xfce"
3-
config.vm.define 'ubuntu'
5+
config.vm.define 'emoflon'
46
config.vm.provider :virtualbox do |vb|
57
vb.name = "emoflon"
68
vb.memory = 8192
79
vb.cpus = 2
810
end
9-
config.vm.provision "shell", path: "prov.sh", privileged: false
11+
config.vm.provision "shell", path: "prov.sh", env: {"GITHUB_TOKEN" => token}, privileged: false
1012

1113
# Prevent SharedFoldersEnableSymlinksCreate errors
1214
config.vm.synced_folder ".", "/vagrant", disabled: true

prov.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ cd ~/eclipse-apps
4646
# Get eclipse
4747
if [[ ! -f "./$ECLIPSE_ARCHIVE.zip" ]]; then
4848
log "Downloading latest eMoflon Eclipse archive from Github."
49-
curl -s https://api.github.com/repos/eMoflon/emoflon-ibex-eclipse-build/releases/latest \
49+
curl -s --header "Authorization: Bearer ${GITHUB_TOKEN}" \
50+
https://api.github.com/repos/eMoflon/emoflon-ibex-eclipse-build/releases/latest \
5051
| grep "$ECLIPSE_ARCHIVE.zip" \
5152
| cut -d : -f 2,3 \
5253
| tr -d \" \
53-
| wget -q -i - \
54+
| wget -q --header="Authorization: Bearer ${GITHUB_TOKEN}" -i - \
5455
|| :
5556
fi
5657

0 commit comments

Comments
 (0)