jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-42270] GithubSCMFile should expose file attributes exposed by GitHub api

Open
#1,056 1 comment 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin component:scm-api-plugin enhancement imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

GitHubSCMFile does not expose attributes that GitHub content API provides via it's API. Some of these are important in order to use it to talk to GitHub APIs. For example pipeline editor can only update Jenkinsfile on Github if it has access to 'sha' of the file.

Its also good idea to expose whats coming from GitHub over to consumer. Most these attributes are already present in GHContent wrapped inside GitHubSCMFile, its matter of exposing these attributes.


  • sha - we need to to use GitHub content API to update Jenkinsfile from pipeline editor

  • size - good to have it known to client

  • encodedContent - File content should be encoded, for example if its binary file. Github by default gives base64 encoded content

  • encoding - GitHub API by default does base64 encoding

  • path - file path relative to root

  • name - name of this file

---
Originally reported by vivek, imported from: GithubSCMFile should expose file attributes exposed by GitHub api


  • status: Open
  • priority: Major
  • component(s): github-branch-source-plugin, scm-api-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 2025-12-02

Raw content of original issue

GitHubSCMFile does not expose attributes that GitHub content API provides via it's API. Some of these are important in order to use it to talk to GitHub APIs. For example pipeline editor can only update Jenkinsfile on Github if it has access to 'sha' of the file.

Its also good idea to expose whats coming from GitHub over to consumer. Most these attributes are already present in GHContent wrapped inside GitHubSCMFile, its matter of exposing these attributes.


  • sha - we need to to use GitHub content API to update Jenkinsfile from pipeline editor

  • size - good to have it known to client

  • encodedContent - File content should be encoded, for example if its binary file. Github by default gives base64 encoded content

  • encoding - GitHub API by default does base64 encoding

  • path - file path relative to root

  • name - name of this file


Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.