@@ -199,7 +199,7 @@ int sfs_mksquashfs(char *source, char *destination, int offset) {
199
199
/* Validate desktop file using desktop-file-validate on the $PATH
200
200
* execlp(), execvp(), and execvpe() search on the $PATH */
201
201
int validate_desktop_file (char * file ) {
202
- int number , statval ;
202
+ int statval ;
203
203
int child_pid ;
204
204
child_pid = fork ();
205
205
if (child_pid == -1 )
@@ -433,12 +433,14 @@ main (int argc, char *argv[])
433
433
* TRAVIS_REPO_SLUG: The slug (in form: owner_name/repo_name) of the repository currently being built.
434
434
* TRAVIS_TAG: If the current build is for a git tag, this variable is set to the tag’s name.
435
435
* We cannot use g_environ_getenv (g_get_environ() since it is too new for CentOS 6 */
436
- char * travis_commit ;
437
- travis_commit = getenv ("TRAVIS_COMMIT" );
436
+ // char* travis_commit;
437
+ // travis_commit = getenv("TRAVIS_COMMIT");
438
438
char * travis_repo_slug ;
439
439
travis_repo_slug = getenv ("TRAVIS_REPO_SLUG" );
440
440
char * travis_tag ;
441
441
travis_tag = getenv ("TRAVIS_TAG" );
442
+ char * travis_pull_request ;
443
+ travis_pull_request = getenv ("TRAVIS_PULL_REQUEST" );
442
444
/* https://github.com/probonopd/uploadtool */
443
445
char * github_token ;
444
446
github_token = getenv ("GITHUB_TOKEN" );
@@ -726,14 +728,24 @@ main (int argc, char *argv[])
726
728
727
729
/* If the user has not provided update information but we know this is a Travis CI build,
728
730
* then fill in update information based on TRAVIS_REPO_SLUG */
729
- if (guessupdateinformation != NULL ){
730
- if (travis_repo_slug != NULL ){
731
+ if (guessupdateinformation ){
732
+ if (!travis_repo_slug ){
733
+ printf ("Cannot guess update information since $TRAVIS_REPO_SLUG is missing\n" );
734
+ } else if (!github_token ) {
735
+ printf ("Will not guess update information since $GITHUB_TOKEN is missing,\n" );
736
+ if (0 != strcmp (travis_pull_request , "false" )){
737
+ printf ("please set it in the Travis CI Repository Settings for this project.\n" );
738
+ printf ("You can get one from https://github.com/settings/tokens\n" );
739
+ } else {
740
+ printf (", which is expected since this is a pull request\n" );
741
+ }
742
+ } else {
731
743
gchar * zsyncmake_path = g_find_program_in_path ("zsyncmake" );
732
744
if (zsyncmake_path ){
733
745
char buf [1024 ];
734
746
gchar * * parts = g_strsplit (travis_repo_slug , "/" , 2 );
735
747
/* https://github.com/AppImage/AppImageSpec/blob/master/draft.md#github-releases
736
- * gh-releases-zsync|probono|AppImages|latest|Subsurface- *-x86_64.AppImage.zsync */
748
+ * gh-releases-zsync|probono|AppImages|latest|Subsurface*-x86_64.AppImage.zsync */
737
749
gchar * channel = "continuous" ;
738
750
if (travis_tag != NULL ){
739
751
if ((strcmp (travis_tag , "" ) != 0 ) && (strcmp (travis_tag , "continuous" ) != 0 )) {
@@ -747,8 +759,6 @@ main (int argc, char *argv[])
747
759
} else {
748
760
printf ("Will not guess update information since zsyncmake is missing\n" );
749
761
}
750
- } else {
751
- printf ("Cannot guess update information since $TRAVIS_REPO_SLUG is missing\n" );
752
762
}
753
763
}
754
764
0 commit comments